This is the mail archive of the gcc-patches@gcc.gnu.org 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]

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


Jeffrey A Law wrote:
> 
>   In message <35DDBE9E.5485@cs.bris.ac.uk>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  <vmakarov@cygnus.com>
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.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light      
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


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