* __func__ in 2.5.33?
@ 2002-09-03 20:52 Rasmus Andersen
2002-09-03 21:48 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Rasmus Andersen @ 2002-09-03 20:52 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 900 bytes --]
Hi,
I trying to compile the SX driver for the 2.5.33 kernel, I got a
lot of warnings looking like (this is from a test program, not
the driver itself)
test.c: In function `main':
test.c:6: called object is not a function
test.c:6: parse error before string constant
This seems to stem from the recent __FUNCTION__ vs. __func__
change in kernel.h and the SX driver's use of __FUNCTION__ in the
following construct
#define func_enter() sx_dprintk (SX_DEBUG_FLOW, "sx: enter " __FUNCTION__ "\n")
My gcc (vers. 2.96) does not accept the above when __FUNCTION__ is
#defined to be (__func__). I likes __func__ well enough, though.
So I guess my question is whether I should change the above define,
and if so, to what, or if __FUNCTION__ should be defined to something
else?
BTW, it was my impression that the kernel would continue
with __FUNCTION__? Maybe I missed something....
Regards,
Rasmus
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: __func__ in 2.5.33?
2002-09-03 20:52 __func__ in 2.5.33? Rasmus Andersen
@ 2002-09-03 21:48 ` Andrew Morton
2002-09-04 6:34 ` Rasmus Andersen
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2002-09-03 21:48 UTC (permalink / raw)
To: Rasmus Andersen; +Cc: linux-kernel
Rasmus Andersen wrote:
>
> Hi,
>
> I trying to compile the SX driver for the 2.5.33 kernel, I got a
> lot of warnings looking like (this is from a test program, not
> the driver itself)
>
> test.c: In function `main':
> test.c:6: called object is not a function
> test.c:6: parse error before string constant
>
> This seems to stem from the recent __FUNCTION__ vs. __func__
> change in kernel.h and the SX driver's use of __FUNCTION__ in the
> following construct
>
> #define func_enter() sx_dprintk (SX_DEBUG_FLOW, "sx: enter " __FUNCTION__ "\n")
>
The parenthesised (__func__) is there to force you to not try to
perform this string pasting. Support for __FUNCTION__ pasting is
being phased out of gcc.
You need:
#define func_enter() sx_dprintk (SX_DEBUG_FLOW, "sx: enter %s\n", __FUNCTION__)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: __func__ in 2.5.33?
@ 2002-09-03 22:03 Paul Larson
0 siblings, 0 replies; 4+ messages in thread
From: Paul Larson @ 2002-09-03 22:03 UTC (permalink / raw)
To: rasmus; +Cc: lkml
[-- Attachment #1: Type: text/plain, Size: 87 bytes --]
I posted this a few days ago, but I don't think it's been picked up yet.
-Paul Larson
[-- Attachment #2: Forwarded message - [TRIVIAL][PATCH] fix __FUNCTION__ pasting in sx.c --]
[-- Type: message/rfc822, Size: 1759 bytes --]
From: Paul Larson <plars@linuxtestproject.org>
To: Trivial Patch Monkey <trivial@rustcorp.com.au>, lkml <linux-kernel@vger.kernel.org>
Subject: [TRIVIAL][PATCH] fix __FUNCTION__ pasting in sx.c
Date: 29 Aug 2002 15:49:14 -0500
Message-ID: <1030654155.7151.1.camel@plars.austin.ibm.com>
Trivial fix for __FUNCTION__ pasting in sx.c against current bk tree.
-Paul Larson
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.557 -> 1.558
# drivers/char/sx.c 1.10 -> 1.11
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/29 plars@austin.ibm.com 1.558
# fix __FUNCTION__ pasting in sx.c
# --------------------------------------------
#
diff -Nru a/drivers/char/sx.c b/drivers/char/sx.c
--- a/drivers/char/sx.c Thu Aug 29 15:43:20 2002
+++ b/drivers/char/sx.c Thu Aug 29 15:43:20 2002
@@ -405,11 +405,11 @@
-#define func_enter() sx_dprintk (SX_DEBUG_FLOW, "sx: enter " __FUNCTION__ "\n")
-#define func_exit() sx_dprintk (SX_DEBUG_FLOW, "sx: exit " __FUNCTION__ "\n")
+#define func_enter() sx_dprintk (SX_DEBUG_FLOW, "sx: enter %s\n", __FUNCTION__)
+#define func_exit() sx_dprintk (SX_DEBUG_FLOW, "sx: exit %s\n", __FUNCTION__)
-#define func_enter2() sx_dprintk (SX_DEBUG_FLOW, "sx: enter " __FUNCTION__ \
- "(port %d)\n", port->line)
+#define func_enter2() sx_dprintk (SX_DEBUG_FLOW, "sx: enter %s (port %d)\n", \
+ __FUNCTION__, port->line)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: __func__ in 2.5.33?
2002-09-03 21:48 ` Andrew Morton
@ 2002-09-04 6:34 ` Rasmus Andersen
0 siblings, 0 replies; 4+ messages in thread
From: Rasmus Andersen @ 2002-09-04 6:34 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 490 bytes --]
On Tue, Sep 03, 2002 at 02:48:40PM -0700, Andrew Morton wrote:
> The parenthesised (__func__) is there to force you to not try to
> perform this string pasting. Support for __FUNCTION__ pasting is
> being phased out of gcc.
>
> You need:
>
> #define func_enter() sx_dprintk (SX_DEBUG_FLOW, "sx: enter %s\n", __FUNCTION__)
Ah, OK. I apparently missed the part about the pasting part
being phased out, alongside missing Paul Larson's patch.
Thanks to both of you,
Rasmus
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-09-04 6:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-03 20:52 __func__ in 2.5.33? Rasmus Andersen
2002-09-03 21:48 ` Andrew Morton
2002-09-04 6:34 ` Rasmus Andersen
-- strict thread matches above, loose matches on Subject: below --
2002-09-03 22:03 Paul Larson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox