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

Re: Making perl with -Wall

Thread Previous
From:
Paul D. Smith
Date:
May 24, 2001 09:32
Subject:
Re: Making perl with -Wall
Message ID:
p5vgmqd7yu.fsf@lemming.engeast.baynetworks.com
%% Jarkko Hietaniemi <jhi@iki.fi> 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 <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

Thread Previous


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