[llvm-bugs] [Bug 25110] New: "Implicit int" is still available for function parameters in C99

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 8 08:19:06 PDT 2015


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

            Bug ID: 25110
           Summary: "Implicit int" is still available for function
                    parameters in C99
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mimomorin at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

A legacy "implicit int" feature of was removed in C99.
But Clang still allows it for function parameters (e.g. `void f(x) {}`)
and produces no warnings unless `-pedantic` is specified.

Clang should produce warnings (at least).

For reference, here is a list of "implicit int" warnings/errors in C99 mode: 

  void f(x) {};
    [no warning!]

  void g(x);
    [error]
    a parameter list without types is only allowed in a function definition

  x;
    [warning]
    type specifier missing, defaults to 'int' [-Wimplicit-int]

(gcc produces warnings for all the three cases.)

-- 
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/20151008/0e22c11c/attachment-0001.html>


More information about the llvm-bugs mailing list