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

            Bug ID: 34092
           Summary: Misleading warning produced for tentative array
                    definition
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: r...@lemma-one.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 18918
  --> https://bugs.llvm.org/attachment.cgi?id=18918&action=edit
Example of tentative definitions. Compile with clang -o tentative tentative.c

It is valid (if strange) C to give a tentative definition of an array with an
array bound unspecified and then specify the bound in a subsequent declaration.
clang immediately issues a warning "tentative array definition assumed to have
one element" when it encounters the tentative definition. This is misleading
because the compiler should not make that assumption until it has processed the
entire translation unit and found that the composite type has an unspecified
bound. (See C99 section 6.9.2 External Object Definitions, particularly Example
2.)

The attached example shows that the compiler is actually conforming with the
standard despite the warning.

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

Reply via email to