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

Re: Making perl with -Wall

Thread Previous | Thread Next
Andy Dougherty
May 24, 2001 11:35
Re: Making perl with -Wall
Message ID:
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_)

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

>   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
    Dept. of Physics
    Lafayette College, Easton PA 18042

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