Commit bda67431 by Joseph Myers Committed by Joseph Myers

c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.

	* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
	c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
	in diagnostics.  Use %' for English apostrophes.
	* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
	(pedwarn_c90, pedwarn_c99): Use it.
	* c-decl.c (lookup_label): Quote label name in diagnostic.
	* c-parse.in (yyprint): Use ' instead of ` for left quote.
	* c-typeck.c (warn_for_assignment): Likewise.

testsuite:
	* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
	gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
	gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
	gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
	Update expected messages.

From-SVN: r87413
parent 924479e8
2004-09-13 Joseph S. Myers <jsm@polyomino.org.uk>
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c,
c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting
in diagnostics. Use %' for English apostrophes.
* c-tree.h (ATTRIBUTE_GCC_CDIAG): Define.
(pedwarn_c90, pedwarn_c99): Use it.
* c-decl.c (lookup_label): Quote label name in diagnostic.
* c-parse.in (yyprint): Use ' instead of ` for left quote.
* c-typeck.c (warn_for_assignment): Likewise.
2004-09-13 Jan Hubicka <jh@suse.cz>
* i386.c (x86_schedule): New global variable.
......
......@@ -584,7 +584,7 @@ interpret_integer (const cpp_token *token, unsigned int flags)
if (itk > itk_unsigned_long
&& (flags & CPP_N_WIDTH) != CPP_N_LARGE
&& ! in_system_header && ! flag_isoc99)
pedwarn ("integer constant is too large for \"%s\" type",
pedwarn ("integer constant is too large for %qs type",
(flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
value = build_int_cst_wide (type, integer.low, integer.high);
......@@ -650,7 +650,7 @@ interpret_float (const cpp_token *token, unsigned int flags)
??? That's a dubious reason... is this a mandatory diagnostic or
isn't it? -- zw, 2001-08-21. */
if (REAL_VALUE_ISINF (real) && pedantic)
warning ("floating constant exceeds range of \"%s\"", type_name);
warning ("floating constant exceeds range of %<%s%>", type_name);
/* Create a node with determined type and value. */
value = build_real (type, real);
......
......@@ -78,7 +78,7 @@ c_cannot_inline_tree_fn (tree *fnp)
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
{
if (do_warning)
warning ("%Jfunction '%F' can never be inlined because it "
warning ("%Jfunction %qF can never be inlined because it "
"is suppressed using -fno-inline", fn, fn);
goto cannot_inline;
}
......@@ -88,7 +88,7 @@ c_cannot_inline_tree_fn (tree *fnp)
if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn))
{
if (do_warning)
warning ("%Jfunction '%F' can never be inlined because it might not "
warning ("%Jfunction %qF can never be inlined because it might not "
"be bound within this unit of translation", fn, fn);
goto cannot_inline;
}
......@@ -96,7 +96,7 @@ c_cannot_inline_tree_fn (tree *fnp)
if (! function_attribute_inlinable_p (fn))
{
if (do_warning)
warning ("%Jfunction '%F' can never be inlined because it uses "
warning ("%Jfunction %qF can never be inlined because it uses "
"attributes conflicting with inlining", fn, fn);
goto cannot_inline;
}
......@@ -111,7 +111,7 @@ c_cannot_inline_tree_fn (tree *fnp)
if (t)
{
if (do_warning)
warning ("%Jfunction '%F' can never be inlined because it has "
warning ("%Jfunction %qF can never be inlined because it has "
"pending sizes", fn, fn);
goto cannot_inline;
}
......@@ -124,7 +124,7 @@ c_cannot_inline_tree_fn (tree *fnp)
if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
{
if (do_warning)
warning ("%Jnested function '%F' can never be inlined because it "
warning ("%Jnested function %qF can never be inlined because it "
"has possibly saved pending sizes", fn, fn);
goto cannot_inline;
}
......
......@@ -144,16 +144,16 @@ c_common_missing_argument (const char *opt, size_t code)
return false;
case OPT_fconstant_string_class_:
error ("no class name specified with \"%s\"", opt);
error ("no class name specified with %qs", opt);
break;
case OPT_A:
error ("assertion missing after \"%s\"", opt);
error ("assertion missing after %qs", opt);
break;
case OPT_D:
case OPT_U:
error ("macro name missing after \"%s\"", opt);
error ("macro name missing after %qs", opt);
break;
case OPT_F:
......@@ -162,7 +162,7 @@ c_common_missing_argument (const char *opt, size_t code)
case OPT_isysroot:
case OPT_isystem:
case OPT_iquote:
error ("missing path after \"%s\"", opt);
error ("missing path after %qs", opt);
break;
case OPT_MF:
......@@ -171,12 +171,12 @@ c_common_missing_argument (const char *opt, size_t code)
case OPT_include:
case OPT_imacros:
case OPT_o:
error ("missing filename after \"%s\"", opt);
error ("missing filename after %qs", opt);
break;
case OPT_MQ:
case OPT_MT:
error ("missing makefile target after \"%s\"", opt);
error ("missing makefile target after %qs", opt);
break;
}
......@@ -539,7 +539,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_fvtable_thunks:
case OPT_fxref:
case OPT_fvtable_gc:
warning ("switch \"%s\" is no longer supported", option->opt_text);
warning ("switch %qs is no longer supported", option->opt_text);
break;
case OPT_faccess_control:
......
......@@ -425,7 +425,7 @@ datadef:
| error '}'
| ';'
{ if (pedantic)
pedwarn ("ISO C does not allow extra `;' outside of a function"); }
pedwarn ("ISO C does not allow extra %<;%> outside of a function"); }
;
fndef:
......@@ -541,7 +541,7 @@ unary_expr:
in_sizeof--;
if (TREE_CODE ($2.value) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND ($2.value, 1)))
error ("`sizeof' applied to a bit-field");
error ("%<sizeof%> applied to a bit-field");
$$ = c_expr_sizeof_expr ($2); }
| sizeof '(' typename ')' %prec HYPERUNARY
{ skip_evaluation--;
......@@ -1286,7 +1286,7 @@ typespec_nonreserved_nonattr:
in_typeof--;
if (TREE_CODE ($3.value) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND ($3.value, 1)))
error ("`typeof' applied to a bit-field");
error ("%<typeof%> applied to a bit-field");
$$ = TREE_TYPE ($3.value);
pop_maybe_used (variably_modified_type_p ($$, NULL_TREE)); }
| typeof '(' typename ')'
......@@ -1431,11 +1431,11 @@ initelt:
pedwarn ("ISO C90 forbids specifying subobject to initialize"); }
| designator initval
{ if (pedantic)
pedwarn ("obsolete use of designated initializer without `='"); }
pedwarn ("obsolete use of designated initializer without %<=%>"); }
| identifier ':'
{ set_init_label ($1);
if (pedantic)
pedwarn ("obsolete use of designated initializer with `:'"); }
pedwarn ("obsolete use of designated initializer with %<:%>"); }
initval
{}
| initval
......@@ -1675,7 +1675,7 @@ structsp_nonattr:
/* In ISO C, enumerated types can be referred to
only if already defined. */
if (pedantic && !COMPLETE_TYPE_P ($$))
pedwarn ("ISO C forbids forward references to `enum' types"); }
pedwarn ("ISO C forbids forward references to %<enum%> types"); }
;
maybecomma:
......@@ -2448,7 +2448,7 @@ parmlist_2: /* empty */
$$->others = 0;
/* Suppress -Wold-style-definition for this case. */
$$->types = error_mark_node;
error ("ISO C requires a named argument before `...'");
error ("ISO C requires a named argument before %<...%>");
}
| parms
{ $$ = get_parm_info (/*ellipsis=*/false); }
......@@ -3480,7 +3480,7 @@ _yylex (void)
/* These tokens should not survive translation phase 4. */
case CPP_HASH:
case CPP_PASTE:
error ("syntax error at '%s' token", NAME(last_token));
error ("syntax error at %qs token", NAME(last_token));
goto get_next;
default:
......@@ -3518,7 +3518,7 @@ yyprint (FILE *file, int yychar, YYSTYPE yyl)
case SCSPEC:
case STATIC:
if (IDENTIFIER_POINTER (t))
fprintf (file, " `%s'", IDENTIFIER_POINTER (t));
fprintf (file, " '%s'", IDENTIFIER_POINTER (t));
break;
case CONSTANT:
......
......@@ -145,7 +145,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
enum { set, push, pop } action;
if (c_lex (&x) != CPP_OPEN_PAREN)
GCC_BAD ("missing '(' after '#pragma pack' - ignored");
GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
token = c_lex (&x);
if (token == CPP_CLOSE_PAREN)
......@@ -158,14 +158,14 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
align = TREE_INT_CST_LOW (x);
action = set;
if (c_lex (&x) != CPP_CLOSE_PAREN)
GCC_BAD ("malformed '#pragma pack' - ignored");
GCC_BAD ("malformed %<#pragma pack%> - ignored");
}
else if (token == CPP_NAME)
{
#define GCC_BAD_ACTION do { if (action != pop) \
GCC_BAD ("malformed '#pragma pack(push[, id][, <n>])' - ignored"); \
GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
else \
GCC_BAD ("malformed '#pragma pack(pop[, id])' - ignored"); \
GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
} while (0)
const char *op = IDENTIFIER_POINTER (x);
......@@ -174,7 +174,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
else if (!strcmp (op, "pop"))
action = pop;
else
GCC_BAD2 ("unknown action '%s' for '#pragma pack' - ignored", op);
GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op);
while ((token = c_lex (&x)) == CPP_COMMA)
{
......@@ -198,10 +198,10 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
#undef GCC_BAD_ACTION
}
else
GCC_BAD ("malformed '#pragma pack' - ignored");
GCC_BAD ("malformed %<#pragma pack%> - ignored");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma pack'");
warning ("junk at end of %<#pragma pack%>");
if (flag_pack_struct)
GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
......@@ -257,7 +257,7 @@ apply_pragma_weak (tree decl, tree value)
if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
&& !DECL_WEAK (decl) /* Don't complain about a redundant #pragma. */
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
warning ("%Japplying #pragma weak '%D' after first use results "
warning ("%Japplying #pragma weak %qD after first use results "
"in unspecified behavior", decl, decl);
declare_weak (decl);
......@@ -578,7 +578,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
{
if (!visidx)
{
GCC_BAD ("No matching push for '#pragma GCC visibility pop'");
GCC_BAD ("No matching push for %<#pragma GCC visibility pop%>");
}
else
{
......@@ -589,7 +589,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
else
{
if (c_lex (&x) != CPP_OPEN_PAREN)
GCC_BAD ("missing '(' after '#pragma GCC visibility push' - ignored");
GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
token = c_lex (&x);
if (token != CPP_NAME)
{
......@@ -618,11 +618,11 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
visibility_options.inpragma = 1;
}
if (c_lex (&x) != CPP_CLOSE_PAREN)
GCC_BAD ("missing '(' after '#pragma GCC visibility push' - ignored");
GCC_BAD ("missing '(' after %<#pragma GCC visibility push%> - ignored");
}
}
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma GCC visibility'");
warning ("junk at end of %<#pragma GCC visibility%>");
}
#endif
......
......@@ -413,8 +413,6 @@ extern void set_init_index (tree, tree);
extern void set_init_label (tree);
extern void process_init_element (struct c_expr);
extern tree build_compound_literal (tree, tree);
extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_PRINTF_1;
extern tree c_start_case (tree);
extern void c_finish_case (tree);
extern tree build_asm_expr (tree, tree, tree, tree, bool);
......@@ -469,5 +467,13 @@ extern void c_write_global_declarations (void);
diagnostic framework extensions, you must include this file before
toplev.h, not after. */
#define GCC_DIAG_STYLE __gcc_cdiag__
#if GCC_VERSION >= 3005
#define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
#else
#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
#endif /* ! GCC_C_TREE_H */
2004-09-13 Joseph S. Myers <jsm@polyomino.org.uk>
* g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C,
gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c,
gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c:
Update expected messages.
2004-09-13 Hans-Peter Nilsson <hp@axis.com>
* gcc.dg/asmreg-1.c (__syscall_getdents64): Adjust signedness
......
......@@ -19,14 +19,14 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
case 4: return 3;
default: break;
}
switch (ei) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
{ /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
switch (ei) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
{ /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
}
switch (ej)
{
default: break;
}
switch (ek) /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
switch (ek) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
{
case e1: return 1;
}
......@@ -50,7 +50,7 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
{
case e1: return 1;
case e2: return 2;
case 3: return 3; /* { dg-warning "case value `3' not in enumerated type `e'" "excess 3" } */
case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'e'" "excess 3" } */
}
switch (ep)
{
......
......@@ -13,7 +13,7 @@ foo (enum e ei, int j)
case e3: return 2;
case e4: return 3;
} /* No warning here since e2 has the same value as e3. */
switch (ei) /* { dg-warning "enumeration value `e4' not handled in switch" "enum e4" } */
switch (ei) /* { dg-warning "enumeration value 'e4' not handled in switch" "enum e4" } */
{
case e1: return 1;
case e2: return 2;
......@@ -22,7 +22,7 @@ foo (enum e ei, int j)
{
case e1: return 1;
} /* No warning here since switch condition was cast to int. */
switch ((enum e) j) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
switch ((enum e) j) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
{
case e2: return 1;
case e4: return 2;
......
......@@ -13,7 +13,7 @@ foo (enum e ei, int j)
case e3: return 2;
case e4: return 3;
} /* No warning here since e2 has the same value as e3. */
switch (ei) /* { dg-warning "enumeration value `e4' not handled in switch" "enum e4" } */
switch (ei) /* { dg-warning "enumeration value 'e4' not handled in switch" "enum e4" } */
{
case e1: return 1;
case e2: return 2;
......@@ -22,7 +22,7 @@ foo (enum e ei, int j)
{
case e1: return 1;
} /* No warning here since switch condition was cast to int. */
switch ((enum e) j) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
switch ((enum e) j) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
{
case e2: return 1;
case e4: return 2;
......
......@@ -19,18 +19,18 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
case 4: return 3;
default: break;
}
switch (ei) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
{ /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
switch (ei) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
{ /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
}
switch (ej) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
{ /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" { target *-*-* } 25 } */
switch (ej) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
{ /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 25 } */
default: break;
}
switch (ek) /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
switch (ek) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
{
case e1: return 1;
}
switch (el) /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
switch (el) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
{
case e1: return 1;
default: break;
......@@ -50,13 +50,13 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
{
case e1: return 1;
case e2: return 2;
case 3: return 3; /* { dg-warning "case value `3' not in enumerated type `enum e'" "excess 3" } */
case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
}
switch (ep)
{
case e1: return 1;
case e2: return 2;
case 3: return 3; /* { dg-warning "case value `3' not in enumerated type `enum e'" "excess 3" } */
case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
default: break;
}
return 0;
......
......@@ -19,14 +19,14 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
case 4: return 3;
default: break;
}
switch (ei) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
{ /*{ dg-warning "enumeration value `e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
switch (ei) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
{ /*{ dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
}
switch (ej)
{
default: break;
}
switch (ek) /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
switch (ek) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
{
case e1: return 1;
}
......@@ -50,7 +50,7 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
{
case e1: return 1;
case e2: return 2;
case 3: return 3; /* { dg-warning "case value `3' not in enumerated type `enum e'" "excess 3" } */
case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
}
switch (ep)
{
......
......@@ -15,31 +15,31 @@ void f5 (register int);
void f6 (static int); /* { dg-error "error: storage class specified for parameter 'type name'" } */
void f7 (typedef int); /* { dg-error "error: storage class specified for parameter 'type name'" } */
auto int x; /* { dg-error "error: file-scope declaration of `x' specifies `auto'" } */
auto int x; /* { dg-error "error: file-scope declaration of 'x' specifies 'auto'" } */
register int y; /* { dg-warning "warning: file-scope declaration of 'y' specifies 'register'" } */
void h (void) { extern void x (void) {} } /* { dg-error "error: nested function `x' declared `extern'" } */
void h (void) { extern void x (void) {} } /* { dg-error "error: nested function 'x' declared 'extern'" } */
/* { dg-warning "warning: ISO C forbids nested functions" "nested" { target *-*-* } 21 } */
void
g (void)
{
void a; /* { dg-error "error: variable or field `a' declared void" } */
const void b; /* { dg-error "error: variable or field `b' declared void" } */
static void c; /* { dg-error "error: variable or field `c' declared void" } */
void a; /* { dg-error "error: variable or field 'a' declared void" } */
const void b; /* { dg-error "error: variable or field 'b' declared void" } */
static void c; /* { dg-error "error: variable or field 'c' declared void" } */
}
void p;
const void p1;
extern void q;
extern const void q1;
static void r; /* { dg-error "error: variable or field `r' declared void" } */
static const void r1; /* { dg-error "error: variable or field `r1' declared void" } */
static void r; /* { dg-error "error: variable or field 'r' declared void" } */
static const void r1; /* { dg-error "error: variable or field 'r1' declared void" } */
register void f8 (void); /* { dg-error "error: invalid storage class for function `f8'" } */
register void f8 (void); /* { dg-error "error: invalid storage class for function 'f8'" } */
/* { dg-warning "warning: file-scope declaration of 'f8' specifies 'register'" "register function" { target *-*-* } 39 } */
void i (void) { auto void y (void) {} } /* { dg-warning "warning: ISO C forbids nested functions" } */
/* { dg-warning "warning: function definition declared 'auto'" "nested" { target *-*-* } 42 } */
inline int main (void) { return 0; } /* { dg-warning "warning: cannot inline function `main'" } */
inline int main (void) { return 0; } /* { dg-warning "warning: cannot inline function 'main'" } */
......@@ -15,31 +15,31 @@ void f5 (register int);
void f6 (static int); /* { dg-error "error: storage class specified for parameter 'type name'" } */
void f7 (typedef int); /* { dg-error "error: storage class specified for parameter 'type name'" } */
auto int x; /* { dg-error "error: file-scope declaration of `x' specifies `auto'" } */
auto int x; /* { dg-error "error: file-scope declaration of 'x' specifies 'auto'" } */
register int y; /* { dg-error "error: file-scope declaration of 'y' specifies 'register'" } */
void h (void) { extern void x (void) {} } /* { dg-error "error: nested function `x' declared `extern'" } */
void h (void) { extern void x (void) {} } /* { dg-error "error: nested function 'x' declared 'extern'" } */
/* { dg-error "error: ISO C forbids nested functions" "nested" { target *-*-* } 21 } */
void
g (void)
{
void a; /* { dg-error "error: variable or field `a' declared void" } */
const void b; /* { dg-error "error: variable or field `b' declared void" } */
static void c; /* { dg-error "error: variable or field `c' declared void" } */
void a; /* { dg-error "error: variable or field 'a' declared void" } */
const void b; /* { dg-error "error: variable or field 'b' declared void" } */
static void c; /* { dg-error "error: variable or field 'c' declared void" } */
}
void p;
const void p1;
extern void q;
extern const void q1;
static void r; /* { dg-error "error: variable or field `r' declared void" } */
static const void r1; /* { dg-error "error: variable or field `r1' declared void" } */
static void r; /* { dg-error "error: variable or field 'r' declared void" } */
static const void r1; /* { dg-error "error: variable or field 'r1' declared void" } */
register void f8 (void); /* { dg-error "error: invalid storage class for function `f8'" } */
register void f8 (void); /* { dg-error "error: invalid storage class for function 'f8'" } */
/* { dg-error "error: file-scope declaration of 'f8' specifies 'register'" "register function" { target *-*-* } 39 } */
void i (void) { auto void y (void) {} } /* { dg-error "error: ISO C forbids nested functions" } */
/* { dg-error "error: function definition declared 'auto'" "nested" { target *-*-* } 42 } */
inline int main (void) { return 0; } /* { dg-warning "warning: cannot inline function `main'" } */
inline int main (void) { return 0; } /* { dg-warning "warning: cannot inline function 'main'" } */
......@@ -16,28 +16,28 @@ void f5 (register int);
void f6 (static int); /* { dg-error "error: storage class specified for parameter 'type name'" } */
void f7 (typedef int); /* { dg-error "error: storage class specified for parameter 'type name'" } */
auto int x; /* { dg-error "error: file-scope declaration of `x' specifies `auto'" } */
auto int x; /* { dg-error "error: file-scope declaration of 'x' specifies 'auto'" } */
register int y;
void h (void) { extern void x (void) {} } /* { dg-error "error: nested function `x' declared `extern'" } */
void h (void) { extern void x (void) {} } /* { dg-error "error: nested function 'x' declared 'extern'" } */
void
g (void)
{
void a; /* { dg-error "error: variable or field `a' declared void" } */
const void b; /* { dg-error "error: variable or field `b' declared void" } */
static void c; /* { dg-error "error: variable or field `c' declared void" } */
void a; /* { dg-error "error: variable or field 'a' declared void" } */
const void b; /* { dg-error "error: variable or field 'b' declared void" } */
static void c; /* { dg-error "error: variable or field 'c' declared void" } */
}
void p;
const void p1;
extern void q;
extern const void q1;
static void r; /* { dg-error "error: variable or field `r' declared void" } */
static const void r1; /* { dg-error "error: variable or field `r1' declared void" } */
static void r; /* { dg-error "error: variable or field 'r' declared void" } */
static const void r1; /* { dg-error "error: variable or field 'r1' declared void" } */
register void f8 (void); /* { dg-error "error: invalid storage class for function `f8'" } */
register void f8 (void); /* { dg-error "error: invalid storage class for function 'f8'" } */
void i (void) { auto void y (void) {} }
inline int main (void) { return 0; } /* { dg-warning "warning: cannot inline function `main'" } */
inline int main (void) { return 0; } /* { dg-warning "warning: cannot inline function 'main'" } */
......@@ -16,7 +16,7 @@ struct vtable mtable = {
malloc,
free
}; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } {18} } */
/* { dg-warning "initialization for `mtable._realloc'" "warning regression" { target *-*-* } {18} } */
/* { dg-warning "initialization for 'mtable._realloc'" "warning regression" { target *-*-* } {18} } */
/* With designated initializers, we assume you meant to leave out the
initialization of any blank fields. */
......
......@@ -34,7 +34,7 @@ extern void foo5(void) __attribute__ ((__noreturn__));
void
foo5(void)
{
return; /* { dg-warning "`noreturn' has a `return' statement" "detect invalid return" } */
return; /* { dg-warning "'noreturn' has a 'return' statement" "detect invalid return" } */
} /* { dg-warning "function does return" "detect return from noreturn" } */
extern void foo6(void);
......
......@@ -23,8 +23,8 @@ testfunc1 ()
foo_i (cd); /* { dg-warning "as integer rather than complex" "prototype conversion warning" } */
foo_f (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
foo_f (f); /* { dg-warning "as `float' rather than `double'" "prototype conversion warning" } */
foo_f (ld); /* { dg-warning "as `float' rather than `double'" "prototype conversion warning" } */
foo_f (f); /* { dg-warning "as 'float' rather than 'double'" "prototype conversion warning" } */
foo_f (ld); /* { dg-warning "as 'float' rather than 'double'" "prototype conversion warning" } */
foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment