On Monday 11 March 2013, Marion & Christophe JAILLET wrote: > > AFIAK, __attribute__ is gcc specific. What about non-gcc > >compilers? > > > > What's might be a consequence of a compiler ignoring it (as MSVC > > does), or will it break any other non-gcc compilers? > > > > Gregg > > I proposed it because there was already some __attribute__ > elsewhere in the source code. > It also helped me trigger some missing parameters, so I thought it > would be useful to keep and share it. > > Should there be an issue with other compiler, IMO we would already > be aware of it. > It should also be possible to define a macro that expand to nothing > if the compiler is not gcc.
apr.h already defines __attribute__ to nothing on non-gcc. Making liberal use of __attribute__ is fine and helpful. However, when using newer attributes, one should define a separate macro that depends on the gcc version, in order to avoid warnings on older gccs.
