linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: remove GCC_BINARY_CONSTANT warning
@ 2018-08-27  6:59 Christophe Leroy
  2018-08-27  7:22 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Leroy @ 2018-08-27  6:59 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: linux-kernel

This warning was there to avoid the use of 0bxxx values
as they are not supported by gcc prior to v4.3

Since commit cafa0010cd51f ("Raise the minimum required gcc
version to 4.6"), it's not an issue anymore and using
such values can increase readability of code.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 scripts/checkpatch.pl | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5219280bf7ff..d98650790722 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4933,17 +4933,6 @@ sub process {
 		while ($line =~ m{($Constant|$Lval)}g) {
 			my $var = $1;
 
-#gcc binary extension
-			if ($var =~ /^$Binary$/) {
-				if (WARN("GCC_BINARY_CONSTANT",
-					 "Avoid gcc v4.3+ binary constant extension: <$var>\n" . $herecurr) &&
-				    $fix) {
-					my $hexval = sprintf("0x%x", oct($var));
-					$fixed[$fixlinenr] =~
-					    s/\b$var\b/$hexval/;
-				}
-			}
-
 #CamelCase
 			if ($var !~ /^$Constant$/ &&
 			    $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
-- 
2.13.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] checkpatch: remove GCC_BINARY_CONSTANT warning
  2018-08-27  6:59 [PATCH] checkpatch: remove GCC_BINARY_CONSTANT warning Christophe Leroy
@ 2018-08-27  7:22 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2018-08-27  7:22 UTC (permalink / raw)
  To: Christophe Leroy, Andy Whitcroft, Andrew Morton; +Cc: linux-kernel

On Mon, 2018-08-27 at 06:59 +0000, Christophe Leroy wrote:
> This warning was there to avoid the use of 0bxxx values
> as they are not supported by gcc prior to v4.3
> 
> Since commit cafa0010cd51f ("Raise the minimum required gcc
> version to 4.6"), it's not an issue anymore and using
> such values can increase readability of code.

Seems sensible as the other compilers also support binary literals
from relatively old versions.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf
https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler

> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  scripts/checkpatch.pl | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 5219280bf7ff..d98650790722 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -4933,17 +4933,6 @@ sub process {
>  		while ($line =~ m{($Constant|$Lval)}g) {
>  			my $var = $1;
>  
> -#gcc binary extension
> -			if ($var =~ /^$Binary$/) {
> -				if (WARN("GCC_BINARY_CONSTANT",
> -					 "Avoid gcc v4.3+ binary constant extension: <$var>\n" . $herecurr) &&
> -				    $fix) {
> -					my $hexval = sprintf("0x%x", oct($var));
> -					$fixed[$fixlinenr] =~
> -					    s/\b$var\b/$hexval/;
> -				}
> -			}
> -
>  #CamelCase
>  			if ($var !~ /^$Constant$/ &&
>  			    $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-27  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27  6:59 [PATCH] checkpatch: remove GCC_BINARY_CONSTANT warning Christophe Leroy
2018-08-27  7:22 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).