[LLVMbugs] [Bug 3053] clang doesn't check foo(int a[static 10]) callers (C99)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 13 11:24:33 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=3053

Chandler Carruth <chandlerc at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Chandler Carruth <chandlerc at gmail.com> 2012-06-13 13:24:33 CDT ---
% cat x.c
void foo(int a[static 10]);
void bar() {
  int a[2];
  foo(a);
}

% ./bin/clang -fsyntax-only -pedantic -Wall x.c
x.c:4:3: warning: array argument is too small; contains 2 elements, callee 
requires at least 10 [-Warray-bounds]
  foo(a);
  ^   ~
x.c:1:14: note: callee declares array parameter as static here
void foo(int a[static 10]);
             ^~~~~~~~~~~~
1 warning generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list