History

checkpatch: remove GCC_BINARY_CONSTANT warning

This warning was there to avoid the use of 0bxxx values as they are not supported by gcc prior to v4.3 Since 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. Joe said: : 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

Christophe Leroy committed 8 years ago

Commit 22ebb721 parent 89976001 file · +0 −11Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+0−11
@@ -4934,17 +4934,6 @@ sub process { · 4933 unmodified lines
4934 while ($line =~ m{($Constant|$Lval)}g) {4934 while ($line =~ m{($Constant|$Lval)}g) {
4935 my $var = $1;4935 my $var = $1;
4936 4936
4937#gcc binary extension
4938 if ($var =~ /^$Binary$/) {
4939 if (WARN("GCC_BINARY_CONSTANT",
4940 "Avoid gcc v4.3+ binary constant extension: <$var>\n" . $herecurr) &&
4941 $fix) {
4942 my $hexval = sprintf("0x%x", oct($var));
4943 $fixed[$fixlinenr] =~
4944 s/\b$var\b/$hexval/;
4945 }
4946 }
4947
4948#CamelCase4937#CamelCase
4949 if ($var !~ /^$Constant$/ &&4938 if ($var !~ /^$Constant$/ &&
4950 $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&4939 $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&