A few WARNS6 cleanups

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Mon Jan 3 01:55:09 PST 2005


On 02.01.2005, at 23:13, Chris Pressey wrote:
Anyways. Will be a bit more agressive in the future instead of just
adding casts. The idea was to be conservative in that the reason for
the original choice for the size and/or signedness of a variable may
be important but not necessarily readily apparant. So addings casts
felt less intrusive. In hindsight that was probably not a good idea.
Actually, only one of them turned out to be problematic - I was wrong
about the loop variables in this instance, as many were counting down
(to below 0) as were counting up...
You're right about the underlying cause - there are a lot of variables
where it doesn't make sense for them ever to be negative (block size,
for instance), but they're all declared as plain ints.  This might be
because that's how they're stored on disk - or not - either way it will
be non-trivial to fix this correctly.  The casts are good enough for
now, I think, so unless someone says otherwise, I'll commit this in a
day or so.
I didn't look at the patch or source, so ignore me if I'm off track.

In my opinion we should really fix issues, if there are some, and not 
just cover them by silencing gcc via casts. If there is a problem with 
signedness, there might be as well be one when just casting. Code needs 
to be examined carefully to actually fix those problems.

cheers
  simon
--
/"\
\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News
Attachment:
PGP.sig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00006.pgp
Type: application/octet-stream
Size: 186 bytes
Desc: "Description: This is a digitally signed message part"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20050103/447cf063/attachment-0015.obj>


More information about the Submit mailing list