toplev.c (lang_options): Add -Wlong-long, -Wno-long-long options.
* 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
This commit is contained in:
parent
37785a19fd
commit
795add948b
|
@ -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)
|
Wed Jul 8 02:43:34 1998 Jeffrey A Law (law@cygnus.com)
|
||||||
|
|
||||||
* rtlanal.c (reg_overlap_mentioned_p): Handle STRICT_LOW_PART. If
|
* rtlanal.c (reg_overlap_mentioned_p): Handle STRICT_LOW_PART. If
|
||||||
|
|
10
gcc/c-decl.c
10
gcc/c-decl.c
|
@ -485,6 +485,10 @@ int flag_no_ident = 0;
|
||||||
|
|
||||||
int warn_implicit_int;
|
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;
|
/* Nonzero means message about use of implicit function declarations;
|
||||||
1 means warning; 2 means error. */
|
1 means warning; 2 means error. */
|
||||||
|
|
||||||
|
@ -704,6 +708,10 @@ c_decode_option (argc, argv)
|
||||||
}
|
}
|
||||||
else if (!strcmp (p, "-Wno-implicit"))
|
else if (!strcmp (p, "-Wno-implicit"))
|
||||||
warn_implicit_int = 0, mesg_implicit_function_declaration = 0;
|
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"))
|
else if (!strcmp (p, "-Wwrite-strings"))
|
||||||
warn_write_strings = 1;
|
warn_write_strings = 1;
|
||||||
else if (!strcmp (p, "-Wno-write-strings"))
|
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");
|
error ("`long long long' is too long for GCC");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pedantic && ! in_system_header)
|
if (pedantic && ! in_system_header && warn_long_long)
|
||||||
pedwarn ("ANSI C does not support `long long'");
|
pedwarn ("ANSI C does not support `long long'");
|
||||||
longlong = 1;
|
longlong = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
|
||||||
|
|
||||||
* decl.c (xref_tag): Handle attributes between 'class' and name.
|
* decl.c (xref_tag): Handle attributes between 'class' and name.
|
||||||
|
|
|
@ -329,6 +329,10 @@ extern int flag_no_ident;
|
||||||
|
|
||||||
extern int warn_implicit;
|
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
|
/* Nonzero means warn when all ctors or dtors are private, and the class
|
||||||
has no friends. */
|
has no friends. */
|
||||||
|
|
||||||
|
|
|
@ -8436,7 +8436,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
||||||
{
|
{
|
||||||
if (i == (int) RID_LONG && RIDBIT_SETP (i, specbits))
|
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'");
|
pedwarn ("ANSI C++ does not support `long long'");
|
||||||
if (longlong)
|
if (longlong)
|
||||||
error ("`long long long' is too long for GCC");
|
error ("`long long long' is too long for GCC");
|
||||||
|
|
|
@ -178,6 +178,10 @@ int flag_implicit_templates = 1;
|
||||||
|
|
||||||
int warn_implicit = 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
|
/* Nonzero means warn when all ctors or dtors are private, and the class
|
||||||
has no friends. */
|
has no friends. */
|
||||||
|
|
||||||
|
@ -686,6 +690,8 @@ lang_decode_option (argc, argv)
|
||||||
|
|
||||||
if (!strcmp (p, "implicit"))
|
if (!strcmp (p, "implicit"))
|
||||||
warn_implicit = setting;
|
warn_implicit = setting;
|
||||||
|
else if (!strcmp (p, "long-long"))
|
||||||
|
warn_long_long = setting;
|
||||||
else if (!strcmp (p, "return-type"))
|
else if (!strcmp (p, "return-type"))
|
||||||
warn_return_type = setting;
|
warn_return_type = setting;
|
||||||
else if (!strcmp (p, "ctor-dtor-privacy"))
|
else if (!strcmp (p, "ctor-dtor-privacy"))
|
||||||
|
|
15
gcc/gcc.1
15
gcc/gcc.1
|
@ -193,6 +193,7 @@ in the following sections.
|
||||||
\-Wimplicit\-int
|
\-Wimplicit\-int
|
||||||
\-Wimplicit\-function\-declaration
|
\-Wimplicit\-function\-declaration
|
||||||
\-Winline
|
\-Winline
|
||||||
|
\-Wlong\-long
|
||||||
\-Wmain
|
\-Wmain
|
||||||
\-Wmissing\-prototypes
|
\-Wmissing\-prototypes
|
||||||
\-Wmissing\-declarations
|
\-Wmissing\-declarations
|
||||||
|
@ -2004,6 +2005,20 @@ Warn if an \c
|
||||||
.B \-Wenum\-clash
|
.B \-Wenum\-clash
|
||||||
Warn about conversion between different enumeration types (C++ only).
|
Warn about conversion between different enumeration types (C++ only).
|
||||||
.TP
|
.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
|
.B \-Woverloaded\-virtual
|
||||||
(C++ only.)
|
(C++ only.)
|
||||||
In a derived class, the definitions of virtual functions must match
|
In a derived class, the definitions of virtual functions must match
|
||||||
|
|
|
@ -121,7 +121,8 @@ in the following sections.
|
||||||
-Wid-clash-@var{len} -Wimplicit -Wimplicit-int
|
-Wid-clash-@var{len} -Wimplicit -Wimplicit-int
|
||||||
-Wimplicit-function-declaration -Wimport
|
-Wimplicit-function-declaration -Wimport
|
||||||
-Werror-implicit-function-declaration -Winline
|
-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
|
-Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import
|
||||||
-Wold-style-cast -Woverloaded-virtual -Wparentheses
|
-Wold-style-cast -Woverloaded-virtual -Wparentheses
|
||||||
-Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type
|
-Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type
|
||||||
|
@ -1704,6 +1705,12 @@ main ()
|
||||||
In this example, g++ will synthesize a default @samp{A& operator =
|
In this example, g++ will synthesize a default @samp{A& operator =
|
||||||
(const A&);}, while cfront will use the user-defined @samp{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
|
@item -Werror
|
||||||
Make all warnings into errors.
|
Make all warnings into errors.
|
||||||
@end table
|
@end table
|
||||||
|
|
|
@ -864,6 +864,8 @@ char *lang_options[] =
|
||||||
"-Wno-implicit-int",
|
"-Wno-implicit-int",
|
||||||
"-Wimplicit",
|
"-Wimplicit",
|
||||||
"-Wno-implicit",
|
"-Wno-implicit",
|
||||||
|
"-Wlong-long",
|
||||||
|
"-Wno-long-long",
|
||||||
"-Wmain",
|
"-Wmain",
|
||||||
"-Wno-main",
|
"-Wno-main",
|
||||||
"-Wmissing-braces",
|
"-Wmissing-braces",
|
||||||
|
|
Loading…
Reference in New Issue