lkml.org 
[lkml]   [2017]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[bug report] checkpatch: if statement does not need to be enclosed in parentheses
Hi,

In current linux-next, if you run the script on this piece of
code:

#define FOO(a) \
if (a) { \
something(); \
something_else(); \
}

You should get:

ERROR: Macros with complex values should be enclosed in parentheses
#1: FILE: foo.c:1:
+#define FOO(a) \
+ if (a) { \
+ something(); \
+ something_else(); \
+ }

We could silence checkpatch.pl using "do {} while ()" around the
if statement. However, the "if () {}" statement should be
enough. If someone could confirm this, I'll go and fix it.

Thanks,
Alfonso

\
 
 \ /
  Last update: 2017-04-08 18:08    [W:2.379 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site