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: <1431966162.2870.22.camel@perches.com>
Date:	Mon, 18 May 2015 09:22:42 -0700
From:	Joe Perches <joe@...ches.com>
To:	Alex Dowad <alexinbeijing@...il.com>
Cc:	Andy Whitcroft <apw@...onical.com>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] checkpatch: types found in one source file do not
 affect processing of others

On Mon, 2015-05-18 at 15:33 +0200, Alex Dowad wrote:
> checkpatch uses various cues in its input files to discover the names of
> user-defined types. It then uses that information when processing expressions,
> to discover more style issues.
> 
> Unfortunately, in rare cases, this means that checkpatch may give different
> results if you run it on several files at the same time, or one by one! The
> reason is that it may identify a type (or something that looks like a type)
> in one file, and then carry this information over when processing a different
> file.

True, thanks.

I found the same thing, but hadn't gotten 'round
to submitting a patch for it.

> keep user-defined types in a separate array from built-in ones,
> and reset the array of user-defined types at the beginning of each new
> source file.
[]
> I am not a Perl programmer -- please let me know if there is a better way to
> accomplish what I am trying to do here.

I think nearly no-one _wants_ to be a perl monk.
(Except maybe for the free beer)

> @@ -511,7 +515,7 @@ $misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix;
>  
>  sub build_types {
>  	my $mods = "(?x:  \n" . join("|\n  ", @modifierList) . "\n)";
> -	my $all = "(?x:  \n" . join("|\n  ", @typeList) . "\n)";
> +	my $all = "(?x:  \n" . join("|\n  ", @allTypeList) . "\n)";
>  	my $Misordered = "(?x:  \n" . join("|\n  ", @typeListMisordered) . "\n)";
>  	my $allWithAttr = "(?x:  \n" . join("|\n  ", @typeListWithAttr) . "\n)";
>  	$Modifier	= qr{(?:$Attribute|$Sparse|$mods)};
> @@ -745,6 +749,7 @@ for my $filename (@ARGV) {
>  	@fixed = ();
>  	@fixed_inserted = ();
>  	@fixed_deleted = ();
> +	@allTypeList = (@typeList);
>  	$fixlinenr = -1;
>  }

I think a proper solution requires a bit more than this.

I believe both @modifierList and @typeList need to be reset
before each new file is processed.

I'll play with it.

Thanks Alex.

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