summaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-09 20:33:51 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-09 20:33:51 +0000
commit064b0d02d33060861fdc33ee867bbcd19a8897a4 (patch)
tree92fa4e29eb5d8ccef0c7ca0f2d1bbf5232779d5c /gcc/c
parent835648fec898c65ca3aedfc550802ea954c67fde (diff)
downloadgcc-064b0d02d33060861fdc33ee867bbcd19a8897a4.tar.gz
PR c/36446
* c-typeck.c (error_init): Call inform instead of error_at. (pedwarn_init): Call inform instead of pedwarn. (warning_init): Call inform instead of warning_at. * gcc.dg/Wcxx-compat-6.c: Change dg-warning to dg-message. * gcc.dg/array-2.c: Likewise. * gcc.dg/array-const-2.c: Likewise. * gcc.dg/ucnid-8.c: Likewise. * gcc.dg/vla-init-1.c: Likewise. * gcc.dg/array-const-3.c: Change dg-error to dg-message. * gcc.dg/c99-flex-array-7.c: Likewise. * gcc.dg/init-bad-1.c: Likewise. * gcc.dg/init-bad-3.c: Likewise. * gcc.dg/init-bad-2.c: Change dg-error and dg-warning to dg-message. * gcc.dg/pedwarn-init.c: Add dg-warning. * gcc.dg/pr53119.c: Remove dg-excess-errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog7
-rw-r--r--gcc/c/c-typeck.c16
2 files changed, 16 insertions, 7 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 47cf3cc3093..86372fa3035 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-09 Marek Polacek <polacek@redhat.com>
+
+ PR c/36446
+ * c-typeck.c (error_init): Call inform instead of error_at.
+ (pedwarn_init): Call inform instead of pedwarn.
+ (warning_init): Call inform instead of warning_at.
+
2014-06-07 Jan Hubicka <hubicka@ucw.cz>
* c-decl.c (merge_decls): Use set_decl_section_name.
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index e4fa0c3b4bc..63bd65ee0be 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -5567,7 +5567,7 @@ error_init (location_t loc, const char *gmsgid)
error_at (loc, gmsgid);
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
- error_at (loc, "(near initialization for %qs)", ofwhat);
+ inform (loc, "(near initialization for %qs)", ofwhat);
}
/* Issue a pedantic warning for a bad initializer component. OPT is
@@ -5579,12 +5579,13 @@ static void
pedwarn_init (location_t location, int opt, const char *gmsgid)
{
char *ofwhat;
+ bool warned;
/* The gmsgid may be a format string with %< and %>. */
- pedwarn (location, opt, gmsgid);
+ warned = pedwarn (location, opt, gmsgid);
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
- if (*ofwhat)
- pedwarn (location, opt, "(near initialization for %qs)", ofwhat);
+ if (*ofwhat && warned)
+ inform (location, "(near initialization for %qs)", ofwhat);
}
/* Issue a warning for a bad initializer component.
@@ -5597,12 +5598,13 @@ static void
warning_init (location_t loc, int opt, const char *gmsgid)
{
char *ofwhat;
+ bool warned;
/* The gmsgid may be a format string with %< and %>. */
- warning_at (loc, opt, gmsgid);
+ warned = warning_at (loc, opt, gmsgid);
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
- if (*ofwhat)
- warning_at (loc, opt, "(near initialization for %qs)", ofwhat);
+ if (*ofwhat && warned)
+ inform (loc, "(near initialization for %qs)", ofwhat);
}
/* If TYPE is an array type and EXPR is a parenthesized string