[BusyBox] Re: ifconfig: Clean up. [PATCH]

walter harms wharms at bfs.de
Mon Jul 25 10:52:49 UTC 2005


hi,

gcc does not trap all errors
(is there an option to warn for non checked return codes ?)
therefore specialised checkers have there place. e.g.
splint (www.splint.org)
coverity (www.coverity.com commercial)
valgrind (www.valgrind.org mainly memory debugging)

if someone has access to these tools it would be good idea to check for 
errors in the programming code. (even better if someone can do it on a 
regular base with the cvs current.)

re,
	walter


Bernd Petrovitsch wrote:
> On Sun, 2005-07-24 at 21:23 -0500, Rob Landley wrote:
>>On Sunday 24 July 2005 21:08, Jason Schoon wrote:
>>>I agree about reducing the ifdefs, but I always feel a bit leery about
>>>relying on the compiler to remove dead code.  This isn't relevent for
>>>Busybox, but in my other code I always use lint, which throws annoying
>>>warnings on things like that.
> 
> That's actually a reason for using "if(flag)" since the C-code in there
> gets parsed everytime - even if the flag is "false".
> 
>>Busybox isn't 100% Linux dependent, but we generally assume a roughly 
>>equivalent build environment.  The Linux kernel relies _heavily_ on dead code 
>>elimination instead of #ifdefs, and any compiler created in the last 20 years 
> 
> The kernel targets only gcc as compiler and relys heavily on certain
> gcc-defined features.
> AFAIK I don't think that busybox wants to be that gcc-centric.
> 
>>should be capable of doing dead code elimination.  (Heck, even TCC can do it 
>>now.)
> 
> gcc-2 had the bug, that constant text strings in dead code (which are
> otherwise not used) were not removed.
> 
>>And yes, people have come to rely on this, the Linux kernel case in point, but 
>>by no means the only one.  Any Lint tool so old and decrepit it doesn't 
>>understand that people actually _use_ widely available compiler features 
>>isn't necessarily all that useful anymore.  (I could still be convinced 
>>either way, but I know where I'm leaning...)
> 
> With gcc und it's armada of warnings and checks you basically do not
> need any lint anymore. Or is there a pretty usable and decent lint which
> checks much more than gcc?
> Historically there was lint because the C-compilers were pretty generous
> (and erronous BTW).
> But whom I'm talking to?;-)
> 
> 	Bernd
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> busybox mailing list
> busybox at mail.busybox.net
> http://busybox.net/mailman/listinfo/busybox



More information about the busybox mailing list