https://bugs.llvm.org/show_bug.cgi?id=45016

            Bug ID: 45016
           Summary: -Wimplicit-int doesn't fire in -std=gnu90 mode
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: h...@chromium.org
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

For example:

$ cat /tmp/a.c
int f(void) {
  const x = 42;
  return x;
}

$ clang -c -std=gnu90 -Wimplicit-int /tmp/a.c
(no warning)

$ clang -c -Wimplicit-int /tmp/a.c
/tmp/a.c:2:9: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
  const x = 42;
  ~~~~~ ^
1 warning generated.


GCC does not have this issue:

$ gcc -c -std=gnu90 -Wimplicit-int /tmp/a.c
/tmp/a.c: In function ‘f’:
/tmp/a.c:2:9: warning: type defaults to ‘int’ in declaration of ‘x’
[-Wimplicit-int]
    2 |   const x = 42;
      |         ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to