Re: request for comments: the -Wconversion warnings.
Harrie Hazewinkel <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <8022860.1028198499@localhost> |
--On Wednesday, July 31, 2002 10:20 PM +0200 Stipe Tolj <[email protected]> wrote: > Harrie Hazewinkel wrote: >> >> The warnings generated by -Wconversion are enormous in amount. >> I have started to fix some (not even 25%) and one can look >> in the attached file. >> >> What do others think of this?? > > hmm, what's the benefit from switching from -Wall to all various > -Wfoobar?! Most of these are just warnings of declarations which are not correct, duplicate or missing. However, the conversion warnings are a bit overdone maybe, but I know of compilers which gives these warnings default. IMHO, it is wise to check the sizes and so to make them unsigned. However, I guess an unsigned int is enough where in most cases an unsigned long is used. For instance, I also saw once that an octet string function is checked where the length value given as parameter is 0. If so the function returns otherwise does things. However, it it never tested if the value is negative and that was very well possible. Harrie Internet Management Consulting mailto:[email protected] http ://www.mod-snmp.com/ ------------------------------------------------------------------- Author of MOD-SNMP, enabling SNMP management to the Apache server.