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

Re: Making perl with -Wall

Thread Previous | Thread Next
From:
Andy Dougherty
Date:
May 24, 2001 11:35
Subject:
Re: Making perl with -Wall
Message ID:
Pine.SOL.4.10.10105241415460.2443-100000@maxwell.phys.lafayette.edu
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))

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


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