https://llvm.org/bugs/show_bug.cgi?id=26336
Bug ID: 26336 Summary: Clang allows address of array with 'register' storage-class to be taken Product: clang Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: sne...@dei.uc.pt CC: llvm-bugs@lists.llvm.org Classification: Unclassified Example: extern int f(int *); int main() { register int x[1]; return f(x); } The C99 standard, in footnote 100 of ยง6.7.1, states > However, whether or not addressable storage is actually used, the address > of any part of an object declared with storage-class specifier register > cannot be computed, either explicitly (by use of the unary & operator as > discussed in 6.5.3.2) or implicitly (by converting an array name to a > pointer as discussed in 6.3.2.1). Clang already does the right thing for explicit & operators on register variables. However it misses the implicit pointer decay of array types. Thus the example above should fail with a "address of register variable requested" error message. -- 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