Akim Demaille wrote: > Bison is already generating code to define __attribute__. > That's the code that was in glr.c, and which is now used > in yacc.c and lalr1.cc too: > > # b4_attribute_define > # ------------------- > # Provide portability for __attribute__. > m4_define([b4_attribute_define], > [#ifndef __attribute__ > /* This feature is available in gcc versions 2.5 and later. */ > # if (! defined __GNUC__ || __GNUC__ < 2 \ > || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) > # define __attribute__(Spec) /* empty */ > # endif > #endif
Ah, that probably should be updated to match what's in gnulib/lib/stdio.in.h. The "5" is a bit tricky (not that anybody uses compilers that old any more) and the gnulib version knows about __gnu_printf__ versus __printf__. > I expect that you would recommend that we define YY_ATTRIBUTE, > YY_ATTRIBUTE_UNUSED and so forth instead? That's for the generated code, as opposed to uniqstr.h which is for Bison itself, right? Yes, I suppose Bison's YY* macros should track the latest and greatest from Gnulib. Perhaps that tracking could be automated?
