Next question: sizeof(char buf[2042])

Bruce Korb bruce.korb@gmail.com
Wed Jun 20 18:51:00 GMT 2018


Yeah, I guess this is Clang, but is it a legal interpretation for Clang?

In file included from gnu-pw-mgr.c:24:

In file included from ./fwd.h:288:

*./seed.c:178:43: **warning: **sizeof on pointer operation will return size
of 'const char *' instead of 'const char [2042]'*

*      [-Wsizeof-array-decay]*

        char * tag = scribble_get(sizeof (tag_fmt) + strlen(OPT_ARG(TAG)));

*                                          ^~~~~~~*


*It seems like a pretty brain damaged interpretation.*

-- 
 - Bruce



More information about the Gcc mailing list