[llvm-bugs] [Bug 34092] New: Misleading warning produced for tentative array definition
llvm-bugs at lists.llvm.org
Sun Aug 6 07:32:42 PDT 2017
Bug ID: 34092
Summary: Misleading warning produced for tentative array
OS: MacOS X
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: rda at lemma-one.com
CC: llvm-bugs at lists.llvm.org
Created attachment 18918
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
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs