develooper Front page | perl.perl5.porters | Postings from May 2001

Re: Making perl with -Wall

Thread Previous | Thread Next
Michael G Schwern
May 24, 2001 07:40
Re: Making perl with -Wall
Message ID:
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

--- perl.h	2001/05/24 14:22:39	1.2
+++ perl.h	2001/05/24 14:27:24
@@ -226,7 +226,11 @@
 #define NOOP (void)0
+#define dNOOP extern int Perl___notused __attribute__ ((unused))
 #define dNOOP extern int Perl___notused
 #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   <>
Perl6 Quality Assurance     <>	     Kwalitee Is Job One
i gave them some paste
do that funky dance, white boy
i laughed my ass off
	-- Fmh

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About