This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++0x PATCH] "long long" support in C++0x mode
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Doug Gregor <doug dot gregor at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Dec 2007 10:41:15 -0500
- Subject: Re: [C++0x PATCH] "long long" support in C++0x mode
- References: <24b520d20712130646k322ceffaobe50b15a2c477e5b@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Dec 13, 2007 at 09:46:51AM -0500, Doug Gregor wrote:
> 2007-12-13 Douglas Gregor <doug.gregor@gmail.com>
>
> * c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when
> in C++0x mode.
--- c-opts.c (revision 130894)
+++ c-opts.c (working copy)
@@ -1429,7 +1429,9 @@ sanitize_cpp_opts (void)
/* We want -Wno-long-long to override -pedantic -std=non-c99
and/or -Wtraditional, whatever the ordering. */
cpp_opts->warn_long_long
- = warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional);
+ = warn_long_long && ((!flag_isoc99 && (cxx_dialect == cxx98)
+ && pedantic)
+ || warn_traditional);
/* Similarly with -Wno-variadic-macros. No check for c99 here, since
this also turns off warnings about GCCs extension. */
Is it a good idea to use cxx_dialect even for C/ObjC?
It works for now, because cxx_dialect defaults to cxx98 and for C
nothing changes it, but what if cxx_dialect changes to default to cxx0x?
Shouldn't that be instead
= warn_long_long
&& ((pedantic && (c_dialect_cxx ()
? cxx_dialect == cxx98
: !flag_isoc99)) || warn_traditional);
?
Jakub