|
From: | Russ Allbery |
Subject: | Re: [Bug-gnubg] bad __attribute__ handling breaks w/newer standards, newer gcc, & glibc and causes infinite loop |
Date: | Wed, 07 Oct 2015 14:42:26 -0700 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Michael Petch <address@hidden> 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 (address@hidden) <http://www.eyrie.org/~eagle/>
[Prev in Thread] | Current Thread | [Next in Thread] |