autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: probing for compiler attributes?


From: Joshua Hoblitt
Subject: Re: probing for compiler attributes?
Date: Tue, 7 Aug 2007 14:08:02 -1000

That's close but not exactly what I was looking for.  That tells you if
__attribute__() is supported at all but not if __attribute__((malloc)),
__attribute__((deprecated)), etc. works.  If that's the only code in the
wild I guess I'll have to roll my own...

-J

--
On Wed, Aug 08, 2007 at 01:21:48AM +0200, Benoit SIGOURE wrote:
> On Aug 7, 2007, at 11:49 PM, Joshua Hoblitt wrote:
> 
> >Is there a pre-canned AC macro or other reliable means of testing for
> >compiler attributes?
> >
> >I have an awful lot of code that looks something like this:
> >
> >     void *myfunc(char *myvar
> >     #ifdef __GNUC__
> >     ) __attribute__((malloc));
> >     # else // ifdef __GNUC__
> >     );
> >     #endif // ifdef __GNUC__
> >
> >and it has to the potential to get a lot worse if I have to start  
> >testing
> >for what version of GNUC we have to use a new attribute.  While I
> >realize this could all be done with CPP macros it occurred to me it  
> >would
> >be nice to have this information available from config.h.
> >
> 
> Hi,
> The (unofficial) autoconf macro archive has a couple of macros to  
> test some of these, see:
> http://autoconf-archive.cryp.to/macros-by-category.html
> search for `attribute'.
> 
> I hope this helps.
> 
> Cheers,
> 
> -- 
> Benoit Sigoure aka Tsuna
> EPITA Research and Development Laboratory
> 
> 


Attachment: pgpXq37eCdQ8h.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]