--- Comment #3 from Tom Tromey <tromey at gcc dot> ---
(In reply to from comment #2)

> Likewise an expression where the user did "typedef size_t my_size_t;" and 
> then used my_size_t.  And what about expressions resulting from arithmetic 
> on size_t values?  So it may be hard for the compiler to tell exactly what 
> expressions are appropriate for use with %zu (even without direct use of 
> __SIZE_TYPE__).

I think it's still preferable for gcc to be better about this even if it
can't be perfect.

First, in my particular case, I think all the types in question are just
"size_t" -- it's common to use this in spidermonkey.

Second, the problem I have is that I wanted to enable -Wformat.  So, I
wrote a bunch of patches -- which then failed to build on other arches.
In this case, if gcc had warned about size_t/%lu mixups in the code, while
perhaps I wouldn't have caught every possible cross-arch build bug, I
certainly would have far fewer of them.

Reply via email to