-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 4011 |
| Resolution | FIXED |
| Resolved on | Feb 22, 2010 12:54 |
| Version | unspecified |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @efriedma-quic,@tkremenek |
Extended Description
checker-186.
The code below is specifically meant to test edge cases in the standard. C99 says the code below results in "undefined behavior", though GCC accepts it and does what you'd expect.
The analyzer has some kind of internal failure on the following code:
#include <stdio.h>
int main(int argc, char *argv[]) {
register char *rc[] = {"Hello"};
char *rcp = &rc[0][0];
printf("'%s' = '%s' / sizeof: %ld, %ld\n", rcp, rc[0], sizeof(rc), sizeof(rc[0]));
return(0);
}
shell% ./scan-build gcc regp.c -c -Wall -Wextra -std=gnu99
regp.c:3: warning: unused parameter 'argc'
regp.c:3: warning: unused parameter 'argv'
regp.c:5:15: error: address of register variable requested
char *rcp = &rc[0][0];
^~~~~~~~~
1 diagnostic generated.
scan-build: 0 bugs found.
scan-build: The analyzer encountered problems on some source files.
scan-build: Preprocessed versions of these sources were deposited in '/var/folders/WS/WSIqx8iyG+KqH2i-Y8Yy2E+++TI/-Tmp-/scan-build-2009-04-20-9/failures'.
scan-build: Please consider submitting a bug report using these files:
scan-build: http://clang.llvm.org/StaticAnalysisUsage.html#filingbugs