http://llvm.org/bugs/show_bug.cgi?id=20473
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID |--- --- Comment #3 from [email protected] --- (In reply to comment #2) > Isn't this an actual bug in the code that asan correctly reports? > > You are initializing a char array of 3 elements with "", > which is a char array with 2 elements. This is correct. It is guaranteed by the standard (section 8.5.2 [dcl.init.string] paragraph number 3) where you can read: "If there are fewer initializers than there are array elements, each element not explicitly initialized shall be zero-initialized." Please also notice that the issue disappear if you change a layout of the structure like below: struct test { char b[3]; char a[2]; }; > (Please reopen the bug if you disagree) OK. Best regards, -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
