+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
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. */
}
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"))
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;
}
+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.
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. */
{
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");
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. */
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"))
\-Wimplicit\-int
\-Wimplicit\-function\-declaration
\-Winline
+\-Wlong\-long
\-Wmain
\-Wmissing\-prototypes
\-Wmissing\-declarations
.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
-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
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
"-Wno-implicit-int",
"-Wimplicit",
"-Wno-implicit",
+ "-Wlong-long",
+ "-Wno-long-long",
"-Wmain",
"-Wno-main",
"-Wmissing-braces",