GNU bug report logs - #15634
coreutils-8.21 possible coding error ?

Previous Next

Package: coreutils;

Reported by: David Binderman <dcb314 <at> hotmail.com>

Date: Thu, 17 Oct 2013 07:55:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Binderman <dcb314 <at> hotmail.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: coreutils-8.21 possible coding error ?
Date: Thu, 17 Oct 2013 07:33:33 +0000
Hello there,

I just ran the static analysis tool cppcheck over the source code
of coreutils-8.21

It said many things, including

[src/dircolors.c:445]: (warning) Comparison of a boolean value using relational operator (<,>, <= or>=).

Source code is

  if (!print_database < argc)

Some round brackets might help clarify the code

  if ((!print_database) < argc)

or was perhaps

  if (!(print_database < argc))

intended ? Here are some other things cppcheck found.

[lib/mountlist.c:945]: (error) Resource leak: dirp
[lib/sig2str.c:329]: (warning) Logical conjunction always evaluates to false: signum <= -1 && signum>= 0.
[lib/closein.c:91]: (error) fflush() called on input stream 'stdin' results in undefined behaviour.

Regards

David Binderman 		 	   		  



This bug report was last modified 6 years and 284 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.