[llvm-bugs] [Bug 45016] New: -Wimplicit-int doesn't fire in -std=gnu90 mode

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 25 00:40:40 PST 2020


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: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200225/862514ea/attachment-0001.html>


More information about the llvm-bugs mailing list