XCreateGC can generate BadAlloc, BadDrawable, BadFont, BadMatch, BadPixmap, and BadValue errors.

Dennis Clarke dc at oetec.com
Tue Jan 1 22:05:31 UTC 2019


Dumb question I am sure but as I see at :

   https://www.x.org/releases/X11R7.7/doc/man/man3/XCreateGC.3.xhtml

Where it says :

     XCreateGC can generate BadAlloc, BadDrawable, BadFont,
                     BadMatch, BadPixmap, and BadValue errors.


Yes but where exactly are these errors returned?  I see the 
"DIAGNOSTICS" section at the bottom of that page but where does
one fetch the error state?

One may do :

     gc = XCreateGC(dsp, win, valuemask, &values);
     /* note that a 32-bit system will throw a warning about
      * cast from pointer to integer of different size with
      * (int64_t) type used on a pointer comparison. */
     if ((int64_t)gc < 0) { /* just taser me */
         fprintf(stderr, "XCreateGC failed\n");
         exit(EXIT_FAILURE); /* clumsy */
     }


However that just can't be right.

Where is the error state returned ?

dc



More information about the xorg-devel mailing list