lkml.org 
[lkml]   [2008]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scripts/checkpatch.pl: warn about using __FUNCTION__
Date

__FUNCTION__ is gcc specific, __func__ is C99

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
scripts/checkpatch.pl | 5 +++++
1 file changed, 5 insertions(+)

Index: b/scripts/checkpatch.pl
===================================================================
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1557,6 +1557,11 @@ sub process {
if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) {
WARN("unnecessary cast may hide bugs, see
http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
}
+
+# check for gcc specific __FUNCTION__
+ if ($line =~ /__FUNCTION__/) {
+ WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);
+ }
}

# In mailback mode only produce a report in the negative, for

\
 
 \ /
  Last update: 2008-01-14 23:11    [W:0.040 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site