On Thu, May 24, 2001 at 02:06:39PM +0000, Nick Ing-Simmons wrote:
> >> There is a GCC attribute that will silence the warning
> >
> >What about all the other compilers?
> 
> We don't know how to do -Wall on other compilers ;-)
> Though I agree some of them are noisy in this area by default.

'unused' is the attribute.


> >Well, what I'm more curious about is why we have a variable called
> >"Perl___notused" at all and not simply an empty macro?
> 
> Because it is a declaration, and there is a following ';'.

Ahh, right.  {;;;;;;;;} isn't valid in C.

Well, here's a first stab.  It shuts up all the not used warnings.
It probably needs a better check than HASATTRIBUTE, perhaps to see
if that specific attribute (unused) is available.

It also looks like there's some bits in the JPL that probably have
the same issue.

And -Wall has to be added to the config defaults for gcc.  I'll leave
that up to someone else, where that someone else may or may not be
Jarko-shaped.


--- perl.h      2001/05/24 14:22:39     1.2
+++ perl.h      2001/05/24 14:27:24
@@ -226,7 +226,11 @@
 #endif
 
 #define NOOP (void)0
+#ifdef HASATTRIBUTE
+#define dNOOP extern int Perl___notused __attribute__ ((unused))
+#else
 #define dNOOP extern int Perl___notused
+#endif
 
 #ifndef pTHX
 #  define pTHX         void
--- malloc.c    2001/05/24 14:22:45     1.1
+++ malloc.c    2001/05/24 14:30:57
@@ -304,7 +304,11 @@
 #  ifndef pTHX
 #     define pTHX              void
 #     define pTHX_
-#     define dTHX              extern int Perl___notused
+#     ifdef HASATTRIBUTE
+#        define dTHX           extern int Perl___notused __attribute__ ((unused))
+#     else
+#        define dTHX            extern int Perl___notused
+#     endif
 #     define WITH_THX(s)       s
 #  endif
 #  ifndef PERL_GET_INTERP



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
i gave them some paste
do that funky dance, white boy
i laughed my ass off
        -- Fmh

Reply via email to