[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensuse-packaging
Subject:    Re: Re[2]: [opensuse-packaging] Cannot disable an rpmlint error message
From:       Greg Freemyer <greg.freemyer () gmail ! com>
Date:       2010-12-23 16:46:42
Message-ID: AANLkTinK5w43T0pcRO97dnBG6+1H=hXoFE7+_ESgGQQJ () mail ! gmail ! com
[Download RAW message or body]

2010/12/23 Ilya Chernykh <neptunia@mail.ru>:
> 
> 
> > > 
> > > > > So this message is impossible to disable?
> > > > 
> > > > Why would you want the function to return random crap instead of a
> > > > defined value ?
> > > 
> > > Simply because returning zero makes not much more sense. I am not the
> > author
> > > of that software and I see no reason why returning 0 is better than some
> > other
> > > random value. If it is not used, why to patch?
> > > 
> > > Patching requires efforts and maintenance so that the patch to remain
> > > compatible with future versions. Also the program can have no-return
> > problem
> > > in multiple places. Just mechanically adding "return 0" or
> > "return 10" does
> > > not make the program's behavior more predictable.
> > 
> > Just guessing, but it sounds like the right fix is to change the
> > function return type to "void".
> > 
> 
> In that case one have to change not only that function, but also any other file \
> that calls this function, other headers etc. Much more work.

I said the "right fix", not the easiest.

As you say, if the return values are not used then mechanically adding
return 0 or return 10 is just a band-aid to fix the real bug.  No
wonder that approach adds no value.

Changing the return type to void prevents new code from inadvertently
trying to use the return value.  That adds value.

Greg
-- 
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-packaging+help@opensuse.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic