Skip to contentSkip to conversation

checkpatch.pl print the line twice when trailing statements in the same line

DISCUSSION Dotan Barak 3 participants 4 messages Oct 20, 2008 – Nov 12, 2008

lore
Share & tools
lore
#0 lore raw

Hi.

I executed checkpatch.pl version 0.24 on a file and i noticed that when a tailing statement is being declared at the same line with "while, checkpatch prints the erroneous line twice.

Here is an example of the output:

ERROR: trailing statements should be on next line
#651: FILE: idbm.c:651:
+ while (*nl && isspace(c = *nl)) nl++;
+ while (*nl && isspace(c = *nl)) nl++;

Is this is the expected behavior?

Thanks
Dotan

#1 lore raw
Quoted 13 lines · Dotan Barak

Hi.

I executed checkpatch.pl version 0.24 on a file and i noticed that when a tailing statement is being declared at the same line with "while, checkpatch prints the erroneous line twice.

Here is an example of the output:

ERROR: trailing statements should be on next line
#651: FILE: idbm.c:651:

(quoted diff) +2 -0
+               while (*nl && isspace(c = *nl)) nl++;
+               while (*nl && isspace(c = *nl)) nl++;
Quoted 1 line

Is this is the expected behavior?

No that would definintaly not be expected. Will add it to my TODO list.

Thanks for the report.

-apw

#2 lore raw
Quoted 9 lines · Andy Whitcroft
Quoted 8 lines · Dotan Barak

Hi.

I executed checkpatch.pl version 0.24 on a file and i noticed that when a tailing statement is being declared at the same line with "while, checkpatch prints the erroneous line twice.

Here is an example of the output:

Quoted 8 lines
Quoted 6 lines

ERROR: trailing statements should be on next line
#651: FILE: idbm.c:651:

(quoted diff) +2 -0
+               while (*nl && isspace(c = *nl)) nl++;
+               while (*nl && isspace(c = *nl)) nl++;

Is this is the expected behavior?

No that would definintaly not be expected. Will add it to my TODO list.

Ok, this is now fixed up and should be in my next batch of updates.

-apw

#3 lore raw

Thanks.

I noticed another issue:

for the code line:
return (int)0;

I get the following error message:
ERROR: return is not a function, parentheses are not required.

Thanks
Dotan

Quoted 23 lines · Andy Whitcroft
Quoted 9 lines · Andy Whitcroft
Quoted 8 lines · Dotan Barak

Hi.

I executed checkpatch.pl version 0.24 on a file and i noticed that when a tailing statement is being declared at the same line with "while, checkpatch prints the erroneous line twice.

Here is an example of the output:

Quoted 8 lines
Quoted 6 lines

ERROR: trailing statements should be on next line
#651: FILE: idbm.c:651:

(quoted diff) +2 -0
+               while (*nl && isspace(c = *nl)) nl++;
+               while (*nl && isspace(c = *nl)) nl++;

Is this is the expected behavior?

No that would definintaly not be expected. Will add it to my TODO list.

Ok, this is now fixed up and should be in my next batch of updates.

-apw