History

checkpatch: whinge about bool bitfields

Using bool in a bitfield isn't a good idea as the alignment behavior is arch implementation defined. Suggest using unsigned int or u<8|16|32> instead.

Joe Perches committed 8 years ago

Commit 5d430901 parent 38dca981 file · +6 −0Browse files

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

Unified · Split

scripts/checkpatch.pl+6−0
@@ -6251,6 +6251,12 @@ sub process { · 6250 unmodified lines
62516251 }
62526252 }
62536253
6254+# check for bool bitfields
6255+ if ($sline =~ /^.\s+bool\s*$Ident\s*:\s*\d+\s*;/) {
6256+ WARN("BOOL_BITFIELD",
6257+ "Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>\n" . $herecurr);
6258+ }
6259+
62546260 # check for semaphores initialized locked
62556261 if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
62566262 WARN("CONSIDER_COMPLETION",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t