Re: [RFC] ARI related: Use of GCC poison pragma

Joel Brobecker
2012-11-15T17:57:45Z

> > > So would a patch adding
> > > #if (GCC_VERSION >= 3000)
> > > #pragma GCC poison xvasprintf
> > > #endif
> >
> > I don't think we really need the GCC_VERSION check, do we?
>
> I still think that this should only be parsed by GCC. So a
> conditional to restrict to GCC compiler is needed, but I suppose you
> meant that the use of a GCC prior to 3000 is not needed...

I don't see why. Looking at the C 89 reference manual, it clearly states
that unknown pragmas are simply ignored:

| 3.8.6 Pragma directive
|
| Semantics
|
| A preprocessing directive of the form
|
| # pragma pp-tokens<opt> new-line
|
| causes the implementation to behave in an implementation-defined
| manner. Any pragma that is not recognized by the implementation is
| ignored.

So, protecting the pragma with a GCC-specific check seems to be
useless. Or is there something else we're trying to do?

--
Joel