LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] scripts/checkpatch.pl: warn about using __FUNCTION__
@ 2008-01-14 22:19 Bartlomiej Zolnierkiewicz
  2008-01-28 14:10 ` Andy Whitcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-01-14 22:19 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Randy Dunlap, Joel Schopp, linux-kernel


__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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/checkpatch.pl: warn about using __FUNCTION__
  2008-01-14 22:19 [PATCH] scripts/checkpatch.pl: warn about using __FUNCTION__ Bartlomiej Zolnierkiewicz
@ 2008-01-28 14:10 ` Andy Whitcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2008-01-28 14:10 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Randy Dunlap, Joel Schopp, linux-kernel

On Mon, Jan 14, 2008 at 11:19:48PM +0100, Bartlomiej Zolnierkiewicz wrote:
> 
> __FUNCTION__ is gcc specific, __func__ is C99
> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Research seems to indicate this is indeed sensible as __FUNCTION__ can
cause -Werror to trip.  Have applied this for 0.14.

Thanks.

-apw

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-28 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-14 22:19 [PATCH] scripts/checkpatch.pl: warn about using __FUNCTION__ Bartlomiej Zolnierkiewicz
2008-01-28 14:10 ` Andy Whitcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).