[llvm-bugs] [Bug 40211] New: c11: Accepts invalid program with function having internal linkage used but not defined.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 3 03:55:05 PST 2019


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

            Bug ID: 40211
           Summary: c11: Accepts invalid program with function having
                    internal linkage used but not defined.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Test case (prog.c):

  static void f();

  int main()
  {
    f;
  }

Compilation command line:

  clang prog.c -Wall -Wextra -std=c11 -pedantic-errors

Observed behaviour:

  No error message outputed. Only warning messages outputed.

Expected bebehaviour:

  An error message outputed.

  The program is invalid by 6.9/3:

    "... Moreover, if an identifier declared with internal linkage is used in
an
     expression (other than as a part of the operand of a sizeof or _Alignof
     operator whose result is an integer constant), there shall be exactly one
     external definition for the identifier in the translation unit."

Note:

  GCC gives the expected error message.

-- 
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/20190103/c52c0741/attachment.html>


More information about the llvm-bugs mailing list