[LLVMbugs] [Bug 18670] New: Bad warning for 'void f(int[] x)'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 30 02:31:11 PST 2014


            Bug ID: 18670
           Summary: Bad warning for 'void f(int[] x)'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chris at bubblescope.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

If a user accidentally writes an array argument for a function in java style
(int[] x) rather than C (int x[]), the warning is fairly confusing:

void f(int[] x);

y.c:1:14: error: expected ')'
void f(int[] x)
y.c:1:7: note: to match this '('
void f(int[] x)
y.c:1:11: error: parameter name omitted
void f(int[] x)

By the last line we are getting slightly clearer what is going on, but this
still confuses a few of my students (who move from being taught Java to C) each

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/20140130/67a73eab/attachment.html>

More information about the llvm-bugs mailing list