lkml.org 
[lkml]   [2016]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Possible code defects: macros and precedence
From
Date
On Tue, 2016-09-20 at 15:14 +0200, Julia Lawall wrote:
> The semantic patch below finds a binary operator in a macro and a binary
> operator in the use of the macro, and checks if the priority of the
> operator in the macro is higher (lower number) than the priority of the
> operator in the use.  If this is the case, it adds parentheses in the use,
> which is not what one wants, but serves to show where the problem is

Thanks, this works on the trivial example I suggested
without an #include

I've tried it on trivial files with --recursive-includes
and it seems to work there too.

I'll investigate some more convoluted uses later.

btw: There are ~15K checkpatch MACRO_ARG_PRECEDENCE
messages in the -next kernel tree.  That's probably
too many for a theoretical and likely not an actual
problem.

cheers, Joe

\
 
 \ /
  Last update: 2016-09-20 19:07    [W:0.074 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site