aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@cygnus.com>1998-07-08 12:16:05 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>1998-07-08 12:16:05 +0000
commit795add948b87c51500c306fd95acf3388787e786 (patch)
tree1a09517983f5d1a0757410a58f92ae55ac9a33a9 /gcc/cp
parent37785a19fde91819c6f441c49a7e56c5f1ae638c (diff)
downloadgcc-795add948b87c51500c306fd95acf3388787e786.zip
gcc-795add948b87c51500c306fd95acf3388787e786.tar.gz
gcc-795add948b87c51500c306fd95acf3388787e786.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/decl2.c6
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6ad5d3f..3849f64 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 8d05b78..71ae911 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f6b0cfe..d8522e0 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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");
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index fd6167c..8f84407 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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"))