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

Re: Making perl with -Wall

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
May 24, 2001 14:40
Subject:
Re: Making perl with -Wall
Message ID:
20010524162840.A13243@chaos.wustl.edu
On Thu, May 24, 2001 at 02:33:37PM -0400, Andy Dougherty wrote:
> On Thu, 24 May 2001, Paul D. Smith wrote:
> 
> > Note that the FSF folks very carefully considered how to implement
> > attributes, etc. so that they could be easily managed via the
> > preprocessor.  This is why the format seems odd (double parens, for
> > example).
> > 
> > Adding "HASATTRIBUTE", etc. is not the way to do it :)
> 
> While I see your point, I also think that the HASATTRIBUTE way is also a
> perfectly fine way to do it. Note that in fact config.h *already* has
> 
>     #ifndef HASATTRIBUTE
>     #define __attribute__(_arg_)
>     #endif
> 
> which essentially replaces your suggested set of #ifdef tests by a
> Configure-time test.  That way, if some other vendor should implement
> __attribute__, Configure will pick them up automatically.  Also, if some
> existing or new gcc flag disables it, we'll pick that up automatically
> too.
> 
> >   mgs> +#ifdef HASATTRIBUTE
> >   mgs> +#define dNOOP extern int Perl___notused __attribute__ ((unused))
> >   mgs> +#else
> >   mgs>  #define dNOOP extern int Perl___notused
> >   mgs> +#endif
> 
> Either way, this patch can simply become
> 
> >   mgs> +#define dNOOP extern int Perl___notused __attribute__ ((unused))

With this a non-gcc non-attribute cc chokes at:

cc -c  -std -fprm d -ieee -D_INTRINSICS -DLANGUAGE_C -O4    -DVERSION=\"1.77\"  -DXS_VERSION=\"1.77\"  -I../..  DB_File.c
cc: Error: DB_File.xs, line 519: Missing ";". (nosemi)
    dTHX;
----^
cc: Error: DB_File.xs, line 590: Missing ";". (nosemi)
    dTHX;
----^
cc: Error: DB_File.xs, line 668: Missing ";". (nosemi)
    dTHX;
----^
*** Exit 1
Stop.

Everywhere else the above seems to be fine...

> -- 
>     Andy Dougherty		doughera@lafayette.edu
>     Dept. of Physics
>     Lafayette College, Easton PA 18042

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About