diff options
author | Marek Polacek <polacek@redhat.com> | 2014-05-01 07:21:07 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-05-01 07:21:07 +0000 |
commit | c9379ce2a9a18a45eae9877c3c4e6977a414365e (patch) | |
tree | e487579f4c8dfd615782b2e5bf5660167e7006f3 /gcc/c | |
parent | d00887e89999f5f24210f6cd6c3895a64eb9f2cd (diff) | |
download | gcc-c9379ce2a9a18a45eae9877c3c4e6977a414365e.zip gcc-c9379ce2a9a18a45eae9877c3c4e6977a414365e.tar.gz gcc-c9379ce2a9a18a45eae9877c3c4e6977a414365e.tar.bz2 |
re PR c/29467 (-ansi -pedantic accepts _Bool without diagnostic)
PR c/29467
* c-decl.c (declspecs_add_type): Pedwarn if boolean types are used
in C89 mode.
* gcc.dg/pr29467.c: New test.
* gcc.dg/declspec-13.c: Renumber some dg-warnings. Add dg-warnings
about boolean types.
* gfortran.dg/bind_c_usage_24_c.c: Include <stdbool.h>. Change _Bool
to bool.
* gfortran.dg/c_f_pointer_logical_driver.c: Change _Bool to bool.
From-SVN: r209971
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index b10f6f7..e04a38d 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,11 @@ 2014-05-01 Marek Polacek <polacek@redhat.com> + PR c/29467 + * c-decl.c (declspecs_add_type): Pedwarn if boolean types are used + in C89 mode. + +2014-05-01 Marek Polacek <polacek@redhat.com> + PR c/43245 * c-typeck.c (convert_for_assignment): Pass OPT_Wdiscarded_qualifiers instead of 0 to WARN_FOR_QUALIFIERS. diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index e30876c..6e7c589 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -9564,6 +9564,9 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, } return specs; case RID_BOOL: + if (!flag_isoc99 && !in_system_header_at (loc)) + pedwarn (loc, OPT_Wpedantic, + "ISO C90 does not support boolean types"); if (specs->long_p) error_at (loc, ("both %<long%> and %<_Bool%> in " |