On 07/05/2018 05:54 PM, Martin Sebor wrote:
> GCC folds strlen() calls to empty substrings within arrays
> whose elements are explicitly initialized with NULs but
> fails to do the same for elements that are zeroed out
> implicitly. For example:
>
> const char a[7] = "123\000\000\000";
> int
GCC folds strlen() calls to empty substrings within arrays
whose elements are explicitly initialized with NULs but
fails to do the same for elements that are zeroed out
implicitly. For example:
const char a[7] = "123\000\000\000";
int f (void)
{
return strlen (a + 5); // folded
}