Skip to contentSkip to conversation

checkpatch confused by pre-existing #endif

PATCH Pavel Roskin 2 participants 3 messages Jan 13, 2009 – Jan 14, 2009

lore
Share & tools
lore
#0 lore raw

Hello!

This patch confuses checkpatch.pl from Linux 2.6.29-rc1:

====================

foo.h renamed from foo.h.old +4 -0
@@ -3,4 +3,8 @@
 
 
 
+#ifdef FOOBAR
+#define foo
+#endif
+
 #endif /* FOO_H */

====================

$ scripts/checkpatch.pl foo.diff 
Can't use an undefined value as an ARRAY reference at
scripts/checkpatch.pl line 453.

Apparently, the last #endif causes some data to be popped from the stack for preprocessor directives. However, the corresponding #ifdef is outside the patch, so this fails.

Signature · 2 lines
Regards,
Pavel Roskin
#1 lore raw
Quoted 18 lines · Pavel Roskin

Hello!

This patch confuses checkpatch.pl from Linux 2.6.29-rc1:

====================

foo.h renamed from foo.h.old +4 -0
@@ -3,4 +3,8 @@
 
 
 
+#ifdef FOOBAR
+#define foo
+#endif
+
 #endif /* FOO_H */

====================

Quoted 7 lines
$ scripts/checkpatch.pl foo.diff 
Can't use an undefined value as an ARRAY reference at
scripts/checkpatch.pl line 453.

Apparently, the last #endif causes some data to be popped from the stack for preprocessor directives. However, the corresponding #ifdef is outside the patch, so this fails.

Yes this should be fixed in the changes pushed up to Andrew. You can confirm this using the version here:

http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

-apw