[Bug c/87310] New: -Wc90-c99-compat does not warn about bool usage

2018-09-14 Thread kohanyi.robert at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87310

Bug ID: 87310
   Summary: -Wc90-c99-compat does not warn about bool usage
   Product: gcc
   Version: 8.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: kohanyi.robert at gmail dot com
  Target Milestone: ---

Created attachment 44694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44694&action=edit
gcc -v outputs

When compiling code that uses  and bool declarations with
-Wc90-c99-compat (with or without -std=c90), no diagnostic is issued.

Something like this

#include 
#include 
main() {
bool ok = true;
printf("%u\n", ok);
}

when compiled with

gcc -std=c90 -Wc90-c99-compat a.c

there's no warning, but I expected a warn about bool usage.

When it looks like this

#include 
main() {
_Bool ok = 1;
printf("%u\n", ok);
}

the warning `warning: ISO C90 does not support boolean types
[-Wc90-c99-compat]' is raised.

Tried with multiple version of gcc. Attached the output of different gcc -v
runs.

Try it here at tio.run: https://bit.ly/2CXnvXm
StackOverflow thread: https://stackoverflow.com/questions/52307780

[Bug c/87310] -Wc90-c99-compat does not warn about bool usage

2018-09-14 Thread kohanyi.robert at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87310

--- Comment #1 from Róbert Kohányi  ---
Created attachment 44695
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44695&action=edit
a.c preprocessed version

[Bug c/87310] -Wc90-c99-compat does not warn about bool usage

2018-09-15 Thread kohanyi.robert at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87310

--- Comment #3 from Róbert Kohányi  ---
Created attachment 44697
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44697&action=edit
/usr/lib/gcc/x86_64-pc-msys/7.3.0/include/stdbool.h

Here's the referenced  on Windows using gcc 7.3.0

[Bug c/87310] -Wc90-c99-compat does not warn about bool usage

2018-09-15 Thread kohanyi.robert at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87310

--- Comment #4 from Róbert Kohányi  ---
Created attachment 44698
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44698&action=edit
/usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h

Here's the  on Ubuntu using gcc 5.4.0.