DragonFly BSD
DragonFly submit List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: A few WARNS6 cleanups


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Mon, 3 Jan 2005 10:54:12 +0100

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
Description: This is a digitally signed message part



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]