]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
toplev.c (lang_options): Add -Wlong-long, -Wno-long-long options.
authorVladimir N. Makarov <vmakarov@cygnus.com>
Wed, 8 Jul 1998 12:16:05 +0000 (12:16 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Wed, 8 Jul 1998 12:16:05 +0000 (12:16 +0000)
* toplev.c (lang_options): Add -Wlong-long, -Wno-long-long
options.
* c-decl.c (warn_long_long): Define.
(c_decode_option): Parse -Wlong-long, -Wno-long-long options.
(grokdeclarator): Add flag `warn_long_long' as guard for
warning "ANSI C does not support `long long'".
* invoke.texi: Add description of options -Wlong-long,
-Wno-long-long.
* gcc.1: The same as above.
* cp-tree.h (warn_long_long): Define.
* decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
warning "ANSI C++ does not support `long long'".
* decl2.c (warn_long_long): Define.
(lang_decode_option): Parse -Wlong-long, -Wno-long-long options.

From-SVN: r21007

gcc/ChangeLog
gcc/c-decl.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/gcc.1
gcc/invoke.texi
gcc/toplev.c

index ecce7d2d30ec85539995e67d7a301e15b449e18d..9fdfd60490bb2e9fa08dd0cdf6b447bda31ed6a3 100644 (file)
@@ -1,3 +1,15 @@
+1998-07-08  Vladimir N. Makarov  <vmakarov@cygnus.com>
+
+       * toplev.c (lang_options): Add -Wlong-long, -Wno-long-long
+       options.
+       * c-decl.c (warn_long_long): Define.
+       (c_decode_option): Parse -Wlong-long, -Wno-long-long options.
+       (grokdeclarator): Add flag `warn_long_long' as guard for
+       warning "ANSI C does not support `long long'".
+       * invoke.texi: Add description of options -Wlong-long,
+       -Wno-long-long.
+       * gcc.1: The same as above.
+       
 Wed Jul  8 02:43:34 1998  Jeffrey A Law  (law@cygnus.com)
 
        * rtlanal.c (reg_overlap_mentioned_p): Handle STRICT_LOW_PART.  If
index 9901db80e68dfee2a2b2b4b6ef9f00eebd4c29d1..3af985d732d1807da2169c14692d4a5ee8ff3ce0 100644 (file)
@@ -485,6 +485,10 @@ int flag_no_ident = 0;
 
 int warn_implicit_int;
 
+/* Nonzero means warn about usage of long long when `-pedantic'.  */
+
+int warn_long_long = 1;
+
 /* Nonzero means message about use of implicit function declarations;
  1 means warning; 2 means error. */
 
@@ -704,6 +708,10 @@ c_decode_option (argc, argv)
     }
   else if (!strcmp (p, "-Wno-implicit"))
     warn_implicit_int = 0, mesg_implicit_function_declaration = 0;
+  else if (!strcmp (p, "-Wlong-long"))
+    warn_long_long = 1;
+  else if (!strcmp (p, "-Wno-long-long"))
+    warn_long_long = 0;
   else if (!strcmp (p, "-Wwrite-strings"))
     warn_write_strings = 1;
   else if (!strcmp (p, "-Wno-write-strings"))
@@ -4406,7 +4414,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
                      error ("`long long long' is too long for GCC");
                    else
                      {
-                       if (pedantic && ! in_system_header)
+                       if (pedantic && ! in_system_header && warn_long_long)
                          pedwarn ("ANSI C does not support `long long'");
                        longlong = 1;
                      }
index 6ad5d3f345cc275bcbdb2b763bf24d53902ebda5..3849f64c59645b85fb9157df75c351c5424a42be 100644 (file)
@@ -1,3 +1,11 @@
+1998-07-08  Vladimir N. Makarov  <vmakarov@cygnus.com>
+
+       * cp-tree.h (warn_long_long): Define.
+       * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
+       warning "ANSI C++ does not support `long long'".
+       * decl2.c (warn_long_long): Define.
+       (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
+
 1998-07-07  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (xref_tag): Handle attributes between 'class' and name.
index 8d05b783948e2d58cb37c80f6bc916636ac8b6c3..71ae91128e59c8fc82025438d88eccf4273bb6d8 100644 (file)
@@ -329,6 +329,10 @@ extern int flag_no_ident;
 
 extern int warn_implicit;
 
+/* Nonzero means warn about usage of long long when `-pedantic'.  */
+
+extern int warn_long_long;
+
 /* Nonzero means warn when all ctors or dtors are private, and the class
    has no friends.  */
 
index f6b0cfeb077cec5daf071af2456ab55aaccfb275..d8522e0e949ec17bf714501d5d117a0a58f39864 100644 (file)
@@ -8436,7 +8436,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
                {
                  if (i == (int) RID_LONG && RIDBIT_SETP (i, specbits))
                    {
-                     if (pedantic && ! in_system_header)
+                     if (pedantic && ! in_system_header && warn_long_long)
                        pedwarn ("ANSI C++ does not support `long long'");
                      if (longlong)
                        error ("`long long long' is too long for GCC");
index fd6167cb2af0986bd922cb2b72167d83c9509d62..8f844076a016752896f814ccbbb9e5b3be097ea3 100644 (file)
@@ -178,6 +178,10 @@ int flag_implicit_templates = 1;
 
 int warn_implicit = 1;
 
+/* Nonzero means warn about usage of long long when `-pedantic'.  */
+
+int warn_long_long = 1;
+
 /* Nonzero means warn when all ctors or dtors are private, and the class
    has no friends.  */
 
@@ -686,6 +690,8 @@ lang_decode_option (argc, argv)
 
       if (!strcmp (p, "implicit"))
        warn_implicit = setting;
+      else if (!strcmp (p, "long-long"))
+       warn_long_long = setting;
       else if (!strcmp (p, "return-type"))
        warn_return_type = setting;
       else if (!strcmp (p, "ctor-dtor-privacy"))
index 8661aa2b62462039312e8876483f59ae78f4403b..b4ff586e906f9a1ee056d5ec6b5edd8a1129a3da 100644 (file)
--- a/gcc/gcc.1
+++ b/gcc/gcc.1
@@ -193,6 +193,7 @@ in the following sections.
 \-Wimplicit\-int
 \-Wimplicit\-function\-declaration
 \-Winline
+\-Wlong\-long
 \-Wmain
 \-Wmissing\-prototypes
 \-Wmissing\-declarations
@@ -2004,6 +2005,20 @@ Warn if an \c
 .B \-Wenum\-clash
 Warn about conversion between different enumeration types (C++ only).
 .TP
+.B \-Wlong-long
+Warn if
+.B long long \c
+type is used.  This is default.  To inhibit
+the warning messages, use flag `\|\c
+.B \-Wno\-long\-long\c
+\&\|'.  Flags `\|\c
+.B \-W\-long\-long\c
+\&\|' and `\|\c
+.B \-Wno\-long\-long\c
+\&\|' are taken into account only when flag `\|\c
+.B \-pedantic\c
+\&\|' is used.
+.TP
 .B \-Woverloaded\-virtual
 (C++ only.)
 In a derived class, the definitions of virtual functions must match
index 5bfac524c5c15e04d155388920c02f7e5593c5f3..5cd5432bcad466e3a502ba5043a74e935d8da9db 100644 (file)
@@ -121,7 +121,8 @@ in the following sections.
 -Wid-clash-@var{len}  -Wimplicit -Wimplicit-int 
 -Wimplicit-function-declaration  -Wimport
 -Werror-implicit-function-declaration  -Winline
--Wlarger-than-@var{len}  -Wmain  -Wmissing-declarations
+-Wlarger-than-@var{len}  -Wlong-long
+-Wmain  -Wmissing-declarations
 -Wmissing-prototypes  -Wmultichar  -Wnested-externs  -Wno-import  
 -Wold-style-cast  -Woverloaded-virtual  -Wparentheses
 -Wpointer-arith  -Wredundant-decls  -Wreorder  -Wreturn-type
@@ -1704,6 +1705,12 @@ main ()
 In this example, g++ will synthesize a default @samp{A& operator =
 (const A&);}, while cfront will use the user-defined @samp{operator =}.
 
+@item -Wlong-long
+Warn if @samp{long long} type is used.  This is default.  To inhibit
+the warning messages, use @samp{-Wno-long-long}.  Flags
+@samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
+only when @samp{-pedantic} flag is used.
+
 @item -Werror
 Make all warnings into errors.
 @end table
index 1126a4af2fcb7374546b34af7c5a3a1692ca7349..d63b0c25c806e92f46a40537185c8f7ed8b05f0d 100644 (file)
@@ -864,6 +864,8 @@ char *lang_options[] =
   "-Wno-implicit-int",
   "-Wimplicit",
   "-Wno-implicit",
+  "-Wlong-long",
+  "-Wno-long-long",
   "-Wmain",
   "-Wno-main",
   "-Wmissing-braces",