This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3385: -std=foo doesn't work with C++
On Sat, 23 Jun 2001 10:26:59 +0100 Neil Booth <neil@daikokuya.demon.co.uk> wrote:
> > Presumably your specs reorganisation can make all the -std options, and
> > -ansi, alias down to the few values cc1/cc1plus/cpplib need to know about,
> > including having -ansi become -std=c89 when compiling C and -std=c++98
> > when compiling C++ (possibly both on the same driver command line)?
>
> At present, they override each other - whichever comes last wins. The
> driver automatically knows which are valid, and would give an
> appropriate error about invalid ones before the front ends saw them.
> At present, I'm not aliasing them, so the last one on the command line
> would be passed through to the front ends verbatim, but that can be
> easily changed.
>
> I really must post something about what I've done on this. There's a
> small chance I might do it this weekend.
How about the possibility to combine e.g. -std=c99 with -std=c++98
(as long as they don't contradict each other, always giving the last
one precedence) ?
I know that doesn't make much sense since the C and C++ standards
aren't related, AFAIK.
The problem for me is glib.h:
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define g_error(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
__VA_ARGS__)
...
#elif defined (__GNUC__)
#define g_error(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \
format)
...
#else
...
#endif
The __extension__ keyword didn't work here, and the amount of
warnings when using -pedantic is rather annoying. Is it possible
implementing __extension__ for the preprocessor, too?
--Daniel