Michael Petch <[email protected]> writes:

> Based on this I was considering something like:

> #ifndef __attribute__
> # if (defined __GNUC__ \
> && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
> || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
> # define __attribute__(Spec) /* empty */
> # endif
> #endif

> It seems to also handle Sun compilers as well. Anyone have any
> objections to the latter solution?

If I'm reading this properly, it only hides __attribute__ on either old
GCC versions or on Sun compilers, and leaves __attribute__ alone
everywhere else.  That seems much less conservative than hiding
__attribute__ everywhere except compilers claimining to be GCC-compatible
with a new-enough version, which is what my version does.

If bison is getting away with it, maybe I'm either reading it wrong or
this isn't a significant issue, but that version feels likely to fail on
some rando compiler that doesn't support __attribute__.

-- 
Russ Allbery ([email protected])              <http://www.eyrie.org/~eagle/>

_______________________________________________
Bug-gnubg mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gnubg

Reply via email to