PATCH: long long constants and -Wno-long-long

Nathan Sidwell
Tue Sep 1 01:11:00 GMT 1998

Jeffrey A Law wrote:
>   In message <>you write:
>   > Hi,
>   > Currently both gcc and g++ warn about long long constants when in -ansi
>   > -pedantic mode, even when the -Wno-long-long flag is given. This does
>   > not appear to be the expected behaviour. -Wno-long-long explicitly
>   > permits variables of type long long, even in pedantic mode. Therefore I
>   > think the same flag should allow long long literals too. Attached is a
>   > patch to both c-lex.c and cp/lex.c to fix the problem for both C and
>   > C++. Here is a test case, (suitable for both C and C++)
>   > compile with
> I think this is wrong.  If I'm in pedantic mode, I want to know about
> *everything* that is not 100% by the book.   I'm not aware of any case
> where a -Wno-* flag disables a pedantic warning/error.
With G++ extensions other than long long, there is an alternative
keyword (__extension__ etc). These can continue to be used with
-pedantic and don't give warnings. The trouble is, there is no such
alternative spelling of 'long long'. So if the only 64 bit type
available is spelt 'long long' there is a conflict with -pedantic, which
doesn't occur for the other extensions. The -Wno-long-long has been
added to get round this problem and allow you to check your code for
ansi conformance, modulo long long. Arguably, a more consistent way
would have been to add a different spelling of 'long long', just like
the other extensions. But I was not involved in adding that flag. The
Change log entry names
	1998-07-08  Vladimir N. Makarov  <>
for this flag. Mm, quite recent.

The -Wno-long-long flag is documented in gcc/invoke.texi

Now that it's there, this patch just completes that installation.

Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light

More information about the Gcc-patches mailing list