4 ms·
> The fact that you think she's wrong, and that you're right, on this issue, suggests you don't understand how compilers work either. I'm happy to be proven wr
by rifung 9y ago
> The fact that you think she's wrong, and that you're right, on this issue, suggests you don't understand how compilers work either.
I'm happy to be proven wrong and certainly know I have much more to learn but I suspect in this case I was not clear in my comment and consequently you made assumptions about what I think is right or not. Feel free to correct me =] Either way I appreciate the response
> 99% of printf fails are catchable through static analysis, and should be caught that way.
I never said that it wasn't possible! But that would require the compiler have special logic just for printf or in this case the fmt and log packages. Maybe you would think that's the right thing to do, and I can see that point of view, but I suspect you would at least understand why it is a controversial decision and thus not necessarily assume it's there.
- cardiffspaceman 9y agoGCC does catch problems with printf arguments vs the format string and it has mechanisms for defining functions that take the same format strings. I operate at a high enough warning level that I see this type of warning now and then. TL;DR: the compiler DOES have that special logic.
- rifung 9y agoAh interesting to know that GCC does this! I figured there would be compilers which did this but I sadly didn't have any examples. > the compiler DOES have that special logic. Indeed it being a controversial decision does not imply that no compilers would do it; if anything it implies that there should be some compilers which make that choice.