[Bug c++/13358] long long and C++ do not mix well
--- Comment #22 from manu at gcc dot gnu dot org 2009-04-20 22:13 --- Subject: Bug 13358 Author: manu Date: Mon Apr 20 22:12:52 2009 New Revision: 146459 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=146459 Log: 2009-04-21 Manuel Lopez-Ibanez m...@gcc.gnu.org PR c++/13358 * doc/invoke.texi (-Wlong-long): Update description. * c-lex (interpret_integer): Only warn if there was no previous overflow and -Wlong-long is enabled. * c-decl.c (declspecs_add_type): Drop redundant flags. * c.opt (Wlong-long): Init to -1. * c-opts.c (sanitize_cpp_opts): Synchronize cpp's warn_long_long and front-end warn_long_long. Wlong-long only depends on other flags if it is uninitialized. * c-parser.c (disable_extension_diagnostics): warn_long_long is the same for CPP and FE. (restore_extension_diagnostics): Likewise. libcpp/ * init.c (cpp_create_reader): Wlong_long is disabled by default. * expr.c (cpp_classify_number): Give different messages for C and C++ front-ends. cp/ * parser.c (cp_parser_check_decl_spec): Drop redundant flags. * error.c (pedwarn_cxx98): New. * cp-tree.h (pedwarn_cxx98): Declare. testsuite/ * gcc.dg/wtr-int-type-1.c: Use two dg-warning to match two messages. Test for long long in system headers. * gcc.dg/c99-longlong-2.c: New. * g++.dg/warn/pr13358.C: New. * g++.dg/warn/pr13358-2.C: New. * g++.dg/warn/pr13358-3.C: New. * g++.dg/warn/pr13358-4.C: New. Added: trunk/gcc/testsuite/g++.dg/warn/pr13358-2.C trunk/gcc/testsuite/g++.dg/warn/pr13358-3.C trunk/gcc/testsuite/g++.dg/warn/pr13358-4.C trunk/gcc/testsuite/g++.dg/warn/pr13358.C trunk/gcc/testsuite/gcc.dg/c99-longlong-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-decl.c trunk/gcc/c-lex.c trunk/gcc/c-opts.c trunk/gcc/c-parser.c trunk/gcc/c.opt trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/error.c trunk/gcc/cp/parser.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/c90-longlong-1.c trunk/gcc/testsuite/gcc.dg/wtr-int-type-1.c trunk/libcpp/ChangeLog trunk/libcpp/expr.c trunk/libcpp/init.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358
[Bug c++/13358] long long and C++ do not mix well
--- Comment #23 from manu at gcc dot gnu dot org 2009-04-20 22:18 --- FIXED in GCC 4.5. +Warn if @samp{long long} type is used. This is enabled by either +...@option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98 +modes. To inhibit the warning messages, use @option{-Wno-long-long} -- manu at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358
[Bug c++/13358] long long and C++ do not mix well
--- Comment #21 from manu at gcc dot gnu dot org 2009-02-07 20:23 --- There is a patch here: http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00970.html -- manu at gcc dot gnu dot org changed: What|Removed |Added URL||http://gcc.gnu.org/ml/gcc- ||patches/2008- ||10/msg00970.html Keywords||patch http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358
[Bug c++/13358] long long and C++ do not mix well
--- Comment #18 from manu at gcc dot gnu dot org 2008-08-23 11:31 --- I cannot reproduce the warning in C or C++. It seems this got fixed silently. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358
[Bug c++/13358] long long and C++ do not mix well
--- Comment #19 from manu at gcc dot gnu dot org 2008-08-23 12:26 --- OK, sorry, I needed -m32 in the command line to reproduce it. Is there a consensus here? It seems too pedantic to warn for something that GCC can handle perfectly well. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358
[Bug c++/13358] long long and C++ do not mix well
--- Comment #20 from manu at gcc dot gnu dot org 2008-08-23 12:37 --- *** Bug 33736 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358
[Bug c++/13358] long long and C++ do not mix well
--- Comment #17 from lloyd at randombit dot net 2007-08-27 13:14 --- This should probably be reexamined with regards to C++0x, since it includes 'long long' and my reading of the working group draft is that a constant too large to fit into a long should be considered a long long or unsigned long long just as in C99. I think that would mean this warning should be disabled (in C++0x mode) on all platforms. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13358