hgm wrote:Hmm, when I remove the & from &t->name, all the non-sensical warnings and their duplicats disappear. Indeed t->name is an array, which is an address, and I have no idea how you could take the address of an address. Seems to me that this should be an error, rather than a warning. It surely confused the compiler, making it completely lose track of the type of other, unrelated variables.
OK, great. So the &t->name is not really an error, and I don't have to be afraid the ICS will crash because of it. And the type of &t->name is indeed the char (*)[100] mentioned in the spurious warning.
The compiler still seems to go completely haywire on this, however, claiming the argument of strlen (which is want, and not &t->name) has this type. So I can only cross my fingers in the hope it has compiled it as it should...
hgm wrote:The compiler still seems to go completely haywire on this, however, claiming the argument of strlen (which is want, and not &t->name) has this type. So I can only cross my fingers in the hope it has compiled it as it should...
I see this too using gcc 6.3.1 in fedora 24. I think the compiler is working fine, but there are some scary macro definitions involved, presumably to optimize the cases where some of the arguments are known at compile time:
Ah, that explains why that single & (i.e. one argument of the wrong type) would give me such a shitload of warnings, many repeated multiple times. It is a macro, and its expansion introduces severalstrlen calls on each of the strcmp arguments, also on the wrong one.
What confused me here is that there already was a strlen call in the source code, and that the warning doesn't say what the argument of the call was it complains about.
Thanks for clearing it up. This makes it certain that the warnings were inocent, as the pointers were indeedpointing to an array of characters at the right address. Nevertheless it is nice I now silenced them.