lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 23 Oct 2008 20:27:34 +0900
From:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To:	apw@...dowen.org
Cc:	rdunlap@...otime.net, jschopp@...tin.ibm.com,
	linux-kernel@...r.kernel.org
Subject: [checkpatch.pl] two bugs

Hello.

I think these are bugs.

Regards.
-----

Bug 1:
  assignment in 'if' is not warned if '\n' is inserted before the assignment.

# cat /tmp/test1.c
void foo(void)
{
	int i = 0;
	if (0 ||
	    (i = 0) != 0)
		return;
}
# /usr/src/vanilla/linux-2.6.27.3/scripts/checkpatch.pl --file /tmp/test1.c
total: 0 errors, 0 warnings, 7 lines checked

/tmp/test1.c has no obvious style problems and is ready for submission.
# ./scripts/checkpatch.pl-testing --strict --file /tmp/test1.c
total: 0 errors, 0 warnings, 0 checks, 7 lines checked

/tmp/test1.c has no obvious style problems and is ready for submission.



Bug 2:
  'while' placed after 'if { }' block is not handled properly.

# cat /tmp/test2.c
int i;
void foo(void)
{
	if (!i) {
		i++;
		return;
	}
	while (i);
}
# /usr/src/vanilla/linux-2.6.27.3/scripts/checkpatch.pl --file /tmp/test2.c
ERROR: trailing statements should be on next line
#8: FILE: tmp/test2.c:8:
+       while (i);

ERROR: while should follow close brace '}'
#8: FILE: tmp/test2.c:8:
+       }
+       while (i);

total: 2 errors, 0 warnings, 9 lines checked

/tmp/test2.c has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
# ./scripts/checkpatch.pl-testing --strict --file /tmp/test2.c
ERROR: trailing statements should be on next line
#8: FILE: tmp/test2.c:8:
+       while (i);
+       while (i);
ERROR: while should follow close brace '}'
#8: FILE: tmp/test2.c:8:
+       }
+       while (i);

total: 2 errors, 0 warnings, 0 checks, 9 lines checked

/tmp/test2.c has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ