public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* compile warning fix for smb_debug.h
@ 2002-09-13 17:38 Andreas Steinmetz
  2002-09-14  8:28 ` Urban Widmark
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Steinmetz @ 2002-09-13 17:38 UTC (permalink / raw)
  To: urban; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

Hi,
attached is a fix for gcc 3.2 deprecated usage warnings for __FUNCTION__ 
in smb_debug.h. As gcc 2.95.3 doesn't issue the warning and can't handle 
the new macro there's a macro selection based on the compiler major 
version. Patch is against 2.4.20pre7.
-- 
Andreas Steinmetz
D.O.M. Datenverarbeitung GmbH

[-- Attachment #2: smb_debug.h.diff --]
[-- Type: text/plain, Size: 1062 bytes --]

--- fs/smbfs/smb_debug.h.orig	2001-01-01 18:57:08.000000000 +0100
+++ fs/smbfs/smb_debug.h	2002-09-13 19:23:11.000000000 +0200
@@ -10,15 +10,24 @@
  * safety checks that should never happen ??? 
  * these are normally enabled.
  */
+
 #ifdef SMBFS_PARANOIA
+#if __GNUC__>=3
+#define PARANOIA(fmt,x...) printk(KERN_NOTICE "%s: " fmt, __FUNCTION__, ##x)
+#else
 #define PARANOIA(x...) printk(KERN_NOTICE __FUNCTION__ ": " x)
+#endif
 #else
 #define PARANOIA(x...) do { ; } while(0)
 #endif
 
 /* lots of debug messages */
 #ifdef SMBFS_DEBUG_VERBOSE
+#if __GNUC__>=3
+#define VERBOSE(fmt,x...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__, ##x)
+#else
 #define VERBOSE(x...) printk(KERN_DEBUG __FUNCTION__ ": " x)
+#endif
 #else
 #define VERBOSE(x...) do { ; } while(0)
 #endif
@@ -28,7 +37,11 @@
  * too common name.
  */
 #ifdef SMBFS_DEBUG
+#if __GNUC__>=3
+#define DEBUG1(fmt,x...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__, ##x)
+#else
 #define DEBUG1(x...) printk(KERN_DEBUG __FUNCTION__ ": " x)
+#endif
 #else
 #define DEBUG1(x...) do { ; } while(0)
 #endif

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

* Re: compile warning fix for smb_debug.h
  2002-09-13 17:38 compile warning fix for smb_debug.h Andreas Steinmetz
@ 2002-09-14  8:28 ` Urban Widmark
  2002-09-14  8:53   ` Andreas Steinmetz
  2002-09-14 23:21   ` David Weinehall
  0 siblings, 2 replies; 4+ messages in thread
From: Urban Widmark @ 2002-09-14  8:28 UTC (permalink / raw)
  To: Andreas Steinmetz; +Cc: linux-kernel

On Fri, 13 Sep 2002, Andreas Steinmetz wrote:

> Hi,
> attached is a fix for gcc 3.2 deprecated usage warnings for __FUNCTION__ 
> in smb_debug.h. As gcc 2.95.3 doesn't issue the warning and can't handle 
> the new macro there's a macro selection based on the compiler major 
> version. Patch is against 2.4.20pre7.

Why not just take the version from 2.5?
Or is there a problem with this one too and gcc2.95.3?

#ifdef SMBFS_PARANOIA
# define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__ , ## a)
#else
# define PARANOIA(f, a...) do { ; } while(0)
#endif

etc.

Note the extra space ...

/Urban


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

* Re: compile warning fix for smb_debug.h
  2002-09-14  8:28 ` Urban Widmark
@ 2002-09-14  8:53   ` Andreas Steinmetz
  2002-09-14 23:21   ` David Weinehall
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Steinmetz @ 2002-09-14  8:53 UTC (permalink / raw)
  To: Urban Widmark; +Cc: linux-kernel

I'm just wary about the extra blank which is error prone. Otherwise 
there's no problem.

Urban Widmark wrote:
> On Fri, 13 Sep 2002, Andreas Steinmetz wrote:
> 
> 
>>Hi,
>>attached is a fix for gcc 3.2 deprecated usage warnings for __FUNCTION__ 
>>in smb_debug.h. As gcc 2.95.3 doesn't issue the warning and can't handle 
>>the new macro there's a macro selection based on the compiler major 
>>version. Patch is against 2.4.20pre7.
> 
> 
> Why not just take the version from 2.5?
> Or is there a problem with this one too and gcc2.95.3?
> 
> #ifdef SMBFS_PARANOIA
> # define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__ , ## a)
> #else
> # define PARANOIA(f, a...) do { ; } while(0)
> #endif
> 
> etc.
> 
> Note the extra space ...
> 
> /Urban
> 
> 

-- 
Andreas Steinmetz
D.O.M. Datenverarbeitung GmbH


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

* Re: compile warning fix for smb_debug.h
  2002-09-14  8:28 ` Urban Widmark
  2002-09-14  8:53   ` Andreas Steinmetz
@ 2002-09-14 23:21   ` David Weinehall
  1 sibling, 0 replies; 4+ messages in thread
From: David Weinehall @ 2002-09-14 23:21 UTC (permalink / raw)
  To: Urban Widmark; +Cc: Andreas Steinmetz, linux-kernel

On Sat, Sep 14, 2002 at 10:28:06AM +0200, Urban Widmark wrote:
> On Fri, 13 Sep 2002, Andreas Steinmetz wrote:
> 
> > Hi,
> > attached is a fix for gcc 3.2 deprecated usage warnings for __FUNCTION__ 
> > in smb_debug.h. As gcc 2.95.3 doesn't issue the warning and can't handle 
> > the new macro there's a macro selection based on the compiler major 
> > version. Patch is against 2.4.20pre7.
> 
> Why not just take the version from 2.5?
> Or is there a problem with this one too and gcc2.95.3?
> 
> #ifdef SMBFS_PARANOIA
> # define PARANOIA(f, a...) printk(KERN_NOTICE "%s: " f, __FUNCTION__ , ## a)
> #else
> # define PARANOIA(f, a...) do { ; } while(0)
> #endif
> 
> etc.
> 
> Note the extra space ...

I've tried to provoke this error, but been unable to; the code
works just fine even without the extra space. Can anyone
confirm if gcc-2.95.4 in Debian lacks this bug?!

Anyway, *please* can we try to avoid GCC-versioned code as much as
possible? Either we raise the required GCC-version (not possible until
the SPARC64-people become perfectly happy with gcc-3.2) or we stay at
a lower version and work around the warts.


Regards: David Weinehall
-- 
 /> David Weinehall <tao@acc.umu.se> /> Northern lights wander      <\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

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

end of thread, other threads:[~2002-09-14 23:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-13 17:38 compile warning fix for smb_debug.h Andreas Steinmetz
2002-09-14  8:28 ` Urban Widmark
2002-09-14  8:53   ` Andreas Steinmetz
2002-09-14 23:21   ` David Weinehall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox