[cups-devel] cups #defines __attribute__ to be empty

Michael Sweet msweet at apple.com
Sun Jul 8 20:18:30 PDT 2018


Phil,

> On Jul 5, 2018, at 4:30 PM, Phil Race <philip.race at oracle.com> wrote:
> 
> OpenJDK builds use the __attribute__  keyword to indicate symbols are exported
> However cups/versioning.h #defines this to be empty unless the compiler is GNU C.
> See the last few lines here :
> https://github.com/apple/cups/blob/master/cups/versioning.h
> 
> So in our code when we include cups/cups.h cups we lose the value of __attribute__
> and you only find out at runtime when these symbols are loaded via JNI and
> we get a linkage error.
> 
> Why is CUPS doing this ?

Because __attribute__ is a GNU C extension that is also supported by Clang, and there are other source files where we need to use __attribute__ for other GNUisms.  If you are using a different compiler that also supports __attribute__, please let us know and we can update this header accordingly.

> And more importantly can it be fixed ?

Of course, if we know what the fix should be...

_________________________________________________________
Michael Sweet, Senior Printing System Engineer



More information about the cups-devel mailing list