Re: [Exim] Using int vs. size_t in Exim

Pàgina inicial
Delete this message
Reply to this message
Autor: michael
Data:  
A: exim-users
Assumpte: Re: [Exim] Using int vs. size_t in Exim
> Sigh. I wish compilers would default to 'all warnings ON'. I will try
> -pedantic on my test compiles to see what it throws up. Currently I just
> use -Wall.


I did not get any warnings, because Exim never accesses int by size_t
pointers or the other way round. The only conversions happen by casts,
and casting unsigned values to signed or back does not cause a warning.
It's still not nice, because it forbids using size_t where it would
be appropiate.

Using -pedantic would, if possible, still be helpful for
further development. Note that -Wall does not enable all warnings,
just all that are considered interesting by the authors. Usually, I use:

-Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes \
-Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith \
-Wwrite-strings -Wmissing-declarations -Wnested-externs \
-Wundef -pedantic

Some people think that enforces ridiculous clean code, though.

> It's partly "historical", which is a euphemism for my ignorance /
> incompetence / laziness. But occasionally there are values where you
> need to use -1 for "unset", for example.


I was afraid of that.

Michael