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

Nathan Sidwell nathan@cs.bris.ac.uk
Fri Aug 21 11:43:00 GMT 1998


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
	g++ -ansi -pedantic -Wno-long-long
	gcc -ansi -pedantic -Wno-long-long
--begin longlong.ii
void foo()
{
  long long t;
  
  t = 32ll;
}
--end longlong.ii

cheers,

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

ChangeLog entry (for gcc/ChangeLog)

Fri Aug 21 19:23:00 BST 1998  Nathan Sidwell  <nathan@acm.org>

        * c-lex.c (real_yylex): Don't warn about long long constants if 
        we're allowing long long


ChangeLog entry (for gcc/cp/ChangeLog)

Fri Aug 21 19:23:00 BST 1998  Nathan Sidwell  <nathan@acm.org>

        * lex.c (real_yylex): Don't warn about long long constants if
        we're allowing long long


More information about the Gcc-patches mailing list