This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++0x PATCH] "long long" support in C++0x mode

On Thu, Dec 13, 2007 at 09:46:51AM -0500, Doug Gregor wrote:
> 2007-12-13  Douglas Gregor  <>
> 	* 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.  */
-    = 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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]