c-decl.c (build_array_declarator): Say 'ISO C90', not 'ISO C89'.
2002-07-21 Gabriel Dos Reis <gdr@nerim.net> * c-decl.c (build_array_declarator): Say 'ISO C90', not 'ISO C89'. (grokdeclarator): Likewise. * c-format.c (C_STD_NAME): Likewise. * c-lex.c (interpret_integer): Likewise. * c-typeck.c (build_array_ref): Likewise. * cpplex.c (_cpp_lex_direct): Likewise. * toplev.c (documented_lang_options): Likewise. testsuite/ 2002-07-21 Gabriel Dos Reis <gdr@nerim.net> * gcc.dg/c90-arraydecl-1.c: Change C89 too C90. From-SVN: r55629
This commit is contained in:
parent
e2f62855b2
commit
565083069d
9 changed files with 34 additions and 20 deletions
|
@ -1,3 +1,13 @@
|
|||
2002-07-21 Gabriel Dos Reis <gdr@nerim.net>
|
||||
|
||||
* c-decl.c (build_array_declarator): Say 'ISO C90', not 'ISO C89'.
|
||||
(grokdeclarator): Likewise.
|
||||
* c-format.c (C_STD_NAME): Likewise.
|
||||
* c-lex.c (interpret_integer): Likewise.
|
||||
* c-typeck.c (build_array_ref): Likewise.
|
||||
* cpplex.c (_cpp_lex_direct): Likewise.
|
||||
* toplev.c (documented_lang_options): Likewise.
|
||||
|
||||
2002-07-21 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
* c-format.c (T99_I, T99_UI): Remove.
|
||||
|
|
14
gcc/c-decl.c
14
gcc/c-decl.c
|
@ -3115,9 +3115,9 @@ build_array_declarator (expr, quals, static_p, vla_unspec_p)
|
|||
if (pedantic && !flag_isoc99)
|
||||
{
|
||||
if (static_p || quals != NULL_TREE)
|
||||
pedwarn ("ISO C89 does not support `static' or type qualifiers in parameter array declarators");
|
||||
pedwarn ("ISO C90 does not support `static' or type qualifiers in parameter array declarators");
|
||||
if (vla_unspec_p)
|
||||
pedwarn ("ISO C89 does not support `[*]' array declarators");
|
||||
pedwarn ("ISO C90 does not support `[*]' array declarators");
|
||||
}
|
||||
if (vla_unspec_p)
|
||||
warning ("GCC does not yet properly implement `[*]' array declarators");
|
||||
|
@ -3909,7 +3909,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
|||
{
|
||||
if (pedantic && !flag_isoc99 && ! in_system_header
|
||||
&& warn_long_long)
|
||||
pedwarn ("ISO C89 does not support `long long'");
|
||||
pedwarn ("ISO C90 does not support `long long'");
|
||||
longlong = 1;
|
||||
}
|
||||
}
|
||||
|
@ -4110,7 +4110,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
|||
if (specbits & 1 << (int) RID_COMPLEX)
|
||||
{
|
||||
if (pedantic && !flag_isoc99)
|
||||
pedwarn ("ISO C89 does not support complex types");
|
||||
pedwarn ("ISO C90 does not support complex types");
|
||||
/* If we just have "complex", it is equivalent to
|
||||
"complex double", but if any modifiers at all are specified it is
|
||||
the complex form of TYPE. E.g, "complex short" is
|
||||
|
@ -4388,10 +4388,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
|||
if (!flag_isoc99 && pedantic)
|
||||
{
|
||||
if (TREE_CONSTANT (size))
|
||||
pedwarn ("ISO C89 forbids array `%s' whose size can't be evaluated",
|
||||
pedwarn ("ISO C90 forbids array `%s' whose size can't be evaluated",
|
||||
name);
|
||||
else
|
||||
pedwarn ("ISO C89 forbids variable-size array `%s'",
|
||||
pedwarn ("ISO C90 forbids variable-size array `%s'",
|
||||
name);
|
||||
}
|
||||
}
|
||||
|
@ -4434,7 +4434,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
|||
else if (decl_context == FIELD)
|
||||
{
|
||||
if (pedantic && !flag_isoc99 && !in_system_header)
|
||||
pedwarn ("ISO C89 does not support flexible array members");
|
||||
pedwarn ("ISO C90 does not support flexible array members");
|
||||
|
||||
/* ISO C99 Flexible array members are effectively identical
|
||||
to GCC's zero-length array extension. */
|
||||
|
|
|
@ -356,7 +356,7 @@ enum format_std_version
|
|||
? "ISO C++" \
|
||||
: ((FEATURE_VER) == STD_EXT \
|
||||
? "ISO C" \
|
||||
: "ISO C89"))
|
||||
: "ISO C90"))
|
||||
/* Adjust a C standard version, which may be STD_C9L, to account for
|
||||
-Wno-long-long. Returns other standard versions unchanged. */
|
||||
#define ADJ_STD(VER) ((int)((VER) == STD_C9L \
|
||||
|
|
|
@ -853,10 +853,10 @@ interpret_integer (token, flags)
|
|||
if (itk_u < itk_unsigned_long)
|
||||
itk_u = itk_unsigned_long;
|
||||
itk = itk_u;
|
||||
warning ("this decimal constant is unsigned only in ISO C89");
|
||||
warning ("this decimal constant is unsigned only in ISO C90");
|
||||
}
|
||||
else if (warn_traditional)
|
||||
warning ("this decimal constant would be unsigned in ISO C89");
|
||||
warning ("this decimal constant would be unsigned in ISO C90");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1362,7 +1362,7 @@ build_array_ref (array, index)
|
|||
if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo))
|
||||
pedwarn ("ISO C forbids subscripting `register' array");
|
||||
else if (! flag_isoc99 && ! lvalue_p (foo))
|
||||
pedwarn ("ISO C89 forbids subscripting non-lvalue array");
|
||||
pedwarn ("ISO C90 forbids subscripting non-lvalue array");
|
||||
}
|
||||
|
||||
type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array)));
|
||||
|
|
|
@ -1100,7 +1100,7 @@ _cpp_lex_direct (pfile)
|
|||
&& ! buffer->warned_cplusplus_comments)
|
||||
{
|
||||
cpp_error (pfile, DL_PEDWARN,
|
||||
"C++ style comments are not allowed in ISO C89");
|
||||
"C++ style comments are not allowed in ISO C90");
|
||||
cpp_error (pfile, DL_PEDWARN,
|
||||
"(this will be reported only once per input file)");
|
||||
buffer->warned_cplusplus_comments = 1;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2002-07-21 Gabriel Dos Reis <gdr@nerim.net>
|
||||
|
||||
* gcc.dg/c90-arraydecl-1.c: Change C89 too C90.
|
||||
|
||||
2002-07-20 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* gcc.c-torture/execute/20020720-1.c: New testcase.
|
||||
|
|
|
@ -8,24 +8,24 @@
|
|||
it correctly, so gives a warning about this. so we can't yet test here
|
||||
that we get just one error and no warnings. */
|
||||
|
||||
void foo0 (int a, int b[*]); /* { dg-error "ISO C89" "\[*\] not in C89" } */
|
||||
void foo0 (int a, int b[*]); /* { dg-error "ISO C90" "\[*\] not in C90" } */
|
||||
/* { dg-warning "implement" "\[*\] not implemented" { target *-*-* } 11 } */
|
||||
void foo1 (int, int [*]); /* { dg-error "ISO C89" "\[*\] not in C89" } */
|
||||
void foo1 (int, int [*]); /* { dg-error "ISO C90" "\[*\] not in C90" } */
|
||||
/* { dg-warning "implement" "\[*\] not implemented" { target *-*-* } 13 } */
|
||||
|
||||
/* Use of static and type qualifiers (not allowed with abstract declarators)
|
||||
is a C99 feature. */
|
||||
|
||||
void bar0 (int a[const]); /* { dg-bogus "warning" "warning in place of error" } */
|
||||
/* { dg-error "ISO C89" "\[quals\] not in C89" { target *-*-* } 19 } */
|
||||
/* { dg-error "ISO C90" "\[quals\] not in C90" { target *-*-* } 19 } */
|
||||
void bar1 (int a[const 2]); /* { dg-bogus "warning" "warning in place of error" } */
|
||||
/* { dg-error "ISO C89" "\[quals expr\] not in C89" { target *-*-* } 21 } */
|
||||
/* { dg-error "ISO C90" "\[quals expr\] not in C90" { target *-*-* } 21 } */
|
||||
void bar2 (int a[static 2]); /* { dg-bogus "warning" "warning in place of error" } */
|
||||
/* { dg-error "ISO C89" "\[static expr\] not in C89" { target *-*-* } 23 } */
|
||||
/* { dg-error "ISO C90" "\[static expr\] not in C90" { target *-*-* } 23 } */
|
||||
void bar3 (int a[static const 2]); /* { dg-bogus "warning" "warning in place of error" } */
|
||||
/* { dg-error "ISO C89" "\[static quals expr\] not in C89" { target *-*-* } 25 } */
|
||||
/* { dg-error "ISO C90" "\[static quals expr\] not in C90" { target *-*-* } 25 } */
|
||||
void bar4 (int a[const static 2]); /* { dg-bogus "warning" "warning in place of error" } */
|
||||
/* { dg-error "ISO C89" "\[quals static expr\] not in C89" { target *-*-* } 27 } */
|
||||
/* { dg-error "ISO C90" "\[quals static expr\] not in C90" { target *-*-* } 27 } */
|
||||
|
||||
/* Because [*] isn't properly implemented and so warns, we don't test here
|
||||
for [const *] yet. */
|
||||
|
|
|
@ -1196,7 +1196,7 @@ documented_lang_options[] =
|
|||
enabled by default. */
|
||||
|
||||
{ "-ansi",
|
||||
N_("Compile just for ISO C89") },
|
||||
N_("Compile just for ISO C90") },
|
||||
{ "-std= ",
|
||||
N_("Determine language standard") },
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue