From dev-return-9356-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu Mar 06 00:49:00 2003 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 28477 invoked by uid 500); 6 Mar 2003 00:48:59 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 28391 invoked from network); 6 Mar 2003 00:48:59 -0000 Message-ID: <3E669AA6.100@stason.org> Date: Thu, 06 Mar 2003 11:47:34 +1100 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "William A. Rowe, Jr." Cc: dev@apr.apache.org Subject: Re: __attribute__ redefinition warnings References: <3E5D55CC.2080000@stason.org> <5.2.0.9.2.20030305181651.0243fcc0@pop3.rowe-clan.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N William A. Rowe, Jr. wrote: > Stas, to avoid clobbering what the clib headers already do, would... > > #ifndef __attribute__ > #define __attribute__(__x) > #endif > > solve the problem as well? Does defined(_foo_) pick up _foo_(x) declarations? > If not is there such a beast? I suppose that this will do. If I remember correcly it doesn't matter what the argumets are, but the symbol itself. We aren't in C++ here ;) but it's possible that that other macro was defined differently. If that's the case, shouldn't this be overriden? (that's why I've done an unconditional #undef). But I'm not sure what's the correct way to handle this. FWIW, perl defines it as: /* HASATTRIBUTE: * This symbol indicates the C compiler can check for function attributes, * such as printf formats. This is normally only supported by GNU cc. */ /*#define HASATTRIBUTE / **/ #ifndef HASATTRIBUTE #define __attribute__(_arg_) #endif on platforms where __attribute__ is supported, it uncomments: /*#define HASATTRIBUTE / **/ > Bill > > At 05:52 PM 3/5/2003, Stas Bekman wrote: > >>Stas Bekman wrote: >> >>>Can apr.h be changed to undef the __attribute__ macro, if it's already defined, before redefining it? In the mod_perl 2.0 build we have to include include files from perl and apr, so on certain platforms (e.g. aix 4.3.3) people get the following warning: >>>-------- Original Message -------- >>>Subject: make errors with mod_perl-1.99_08 on aix 4.3.3 >>>Date: Wed, 26 Feb 2003 15:34:29 -0500 >>>From: Priest, Darryl - BALTO >>>To: 'modperl@perl.apache.org' >>>I'm getting the warning for every cc in the make: >>>"/usr/local/perl5.8.0/lib/5.8.0/aix/CORE/config.h", line 41.9: 1506-236 (W) >>>Macro name __attribute__ has been redefined. >>>"/usr/local/perl5.8.0/lib/5.8.0/aix/CORE/config.h", line 41.9: 1506-358 (I) >>>"__attribute__" is defined on line 28 of /usr/local/apache/include/apr.h. >> >>will this work? (hopefully sliding into 0.9.2) >> >>Index: include/apr.h.in >>=================================================================== >>RCS file: /home/cvspublic/apr/include/apr.h.in,v >>retrieving revision 1.119 >>diff -u -r1.119 apr.h.in >>--- include/apr.h.in 16 Feb 2003 10:07:54 -0000 1.119 >>+++ include/apr.h.in 5 Mar 2003 23:52:46 -0000 >>@@ -94,6 +94,7 @@ >> (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ >> defined(NEXT) >>#define APR_INLINE >>+#undef __attribute__ >>#define __attribute__(__x) >>#define APR_HAS_INLINE 0 >>#else >> >> >>__________________________________________________________________ >>Stas Bekman JAm_pH ------> Just Another mod_perl Hacker >>http://stason.org/ mod_perl Guide ---> http://perl.apache.org >>mailto:stas@stason.org http://use.perl.org http://apacheweek.com >>http://modperlbook.org http://apache.org http://ticketmaster.com > > -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com