This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] ARI related: Use of GCC poison pragma
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: gdb at sourceware dot org
- Date: Thu, 15 Nov 2012 09:57:38 -0800
- Subject: Re: [RFC] ARI related: Use of GCC poison pragma
- References: <009b01cdc30f$c7684e80$5638eb80$@muller@ics-cnrs.unistra.fr> <20121115151350.GB3806@adacore.com> <000901cdc34d$c7301e50$55905af0$@muller@ics-cnrs.unistra.fr>
> > > 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