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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1418938012.28384.16.camel@perches.com>
Date:	Thu, 18 Dec 2014 13:26:52 -0800
From:	Joe Perches <joe@...ches.com>
To:	Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] checkpatch: Check for use of disallowed macros

On Thu, 2014-12-18 at 22:15 +0100, Rasmus Villemoes wrote:
> On Fri, Dec 12 2014, Joe Perches <joe@...ches.com> wrote:
> > On Fri, 2014-12-12 at 11:51 +0100, Rasmus Villemoes wrote:
> >> Since fe7c36c7 ("Makefile: Build with -Werror=date-time if the
> >> compiler supports it"), use of __DATE__, __TIME__, __TIMESTAMP__ has
> >> been disallowed. This hasn't prevented a few new users from creeping
> >> in. Make checkpatch complain.
> >> +
> >> +# Use of __DATE__, __TIME__, __TIMESTAMP__ is not allowed
> >> +		if ($line =~ m/\b__(?:DATE|TIME|TIMESTAMP)__\b/) {
> >> +		    ERROR("DATETIME", "Do not use the macros __DATE__, __TIME__ and __TIMESTAMP__\n" . $herecurr)
> >
> > I'd probably add that adjacent to the existing __FUNCTION__
> > test near line 5000 and make the test show the specific macro
> > used.
> 
> Yeah, that makes sense. I didn't really know where to put it.
> 
> > Maybe add __LINE__ and __FILE__ as a separate --strict test too.
> 
> Are those also disallowed, or is it just that new users shouldn't be
> added?

I'm not advocating removing existing __FILE__/__LINE__ uses.

I do think __FILE__ and __LINE__ aren't particularly useful.
__FILE__ in particular is overly verbose.

> > Also the error message should should show the specific macro and
> > if __DATE__ and __TIME__ are on the same line, the error should
> > be emitted twice.
> >
> > Maybe:
> > 		while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) {
> > 			ERROR("DATETIME",
> > 			      "Do not use the $1 macro\n" . $herecurr);
> > 		}
> 
> Looks good to me. I could resend, but can't really claim
> authorship. Joe, mind taking it from here?

Your idea, your patch.

I'll add an "original-patch-by:" signature tag
and I'll forward something to Andrew later.


--
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