[Top][All Lists]

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

Re: probing for compiler attributes?

From: Benoit SIGOURE
Subject: Re: probing for compiler attributes?
Date: Wed, 8 Aug 2007 01:21:48 +0200

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.

The (unofficial) autoconf macro archive has a couple of macros to test some of these, see:
search for `attribute'.

I hope this helps.


Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory

Attachment: PGP.sig
Description: This is a digitally signed message part

reply via email to

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