From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Andy Whitcroft <apw@shadowen.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
Joel Schopp <jschopp@austin.ibm.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] scripts/checkpatch.pl: warn about using __FUNCTION__
Date: Mon, 14 Jan 2008 23:19:48 +0100 [thread overview]
Message-ID: <200801142319.48150.bzolnier@gmail.com> (raw)
__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
next reply other threads:[~2008-01-14 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-14 22:19 Bartlomiej Zolnierkiewicz [this message]
2008-01-28 14:10 ` Andy Whitcroft
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200801142319.48150.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=apw@shadowen.org \
--cc=jschopp@austin.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome