Mike Frysinger <[email protected]> writes: > we got a report about gnubg hanging on startup when built w/gcc-5: > https://bugs.gentoo.org/551896 > but when built w/older versions (<=gcc-4.9), everything worked great.
> there seems to be a similar report here from a few months ago: > https://lists.gnu.org/archive/html/bug-gnubg/2015-07/msg00011.html > this is because of bad code in gnubg itself: > http://cvs.savannah.gnu.org/viewvc/gnubg/gnubg/common.h?revision=1.31&view=markup > #if !_GNU_SOURCE && !defined (__attribute__) > /*! \brief GNU C specific attributes, e.g. unused > * // */ > #define __attribute__(X) > #endif [...] > (2) common.h should be changed from checking for _GNU_SOURCE to __GNUC__ since > the attribute is tied to the GNU C compiler. or maybe test whether the > syntax __attribute__ works regardless of other defines. In case it helps, the pattern I use in all of my code, and which I've never had trouble with, is: /* * __attribute__ is available in gcc 2.5 and later, but only with gcc 2.7 * could you use the __format__ form of the attributes, which is what we use * (to avoid confusion with other macros). */ #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __attribute__(spec) /* empty */ # endif #endif This also works with the Intel compiler and with Clang, in my experience. -- Russ Allbery ([email protected]) <http://www.eyrie.org/~eagle/> _______________________________________________ Bug-gnubg mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-gnubg
