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

Re: Making perl with -Wall

Thread Previous
Paul D. Smith
May 24, 2001 09:32
Re: Making perl with -Wall
Message ID:
%% Jarkko Hietaniemi <> writes:

  >> Adding "HASATTRIBUTE", etc. is not the way to do it :)

  jh> Well, we already do have HASATTRIBUTE defined (or not defined,
  jh> whichever the case may be), so there's no "adding" of HASATTRIBUTE.

Well, OK (although I still think it's safer to test the GNUC version
using the predefined macro values).

Nevertheless, I think you should use (the lack of) this attribute to
define __attribute__(()) to be empty, in one spot, then just use it
where you want to rather than wrapping every use of __attribute__(())
inside a HASATTRIBUTE #ifdef.

As I mentioned, this is exactly why the __attribute__(()) enhancement
was implemented using this syntax.

Might as well take advantage of it and save yourself some ifdef-ing :).

 Paul D. Smith <>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

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