On 8/9/07, Joshua Hoblitt <[EMAIL PROTECTED]> wrote:
> On Tue, Aug 07, 2007 at 08:43:54PM -0400, John W. Eaton wrote:
> > Ugh.  Don't do it like that.  Instead, write something like
> >
> >   your-config-header.h:
> >   --------------------
> >   #ifdef __GNUC__
> >   #define ATTR_MALLOC __attribute__((malloc))
> >   #else
> >   #define ATTR_MALLOC
> >   #endif
> >
> > and then in your code, just use
> >
> >   #include "your-config-header.h"
> >   ...
> >   void *myfunc (char *myvar) ATTR_MALLOC;
>
> The more I think about it the more I think this is a bad idea for
> library code.  It certainly makes the code more tidy but doesn't this
> end up screwing any application that tries to link against your code?  I
> don't ever install config.h.
>

I don't see it as more harmful than putting #ifdef in .c files.
You must not install config.h, indeed.
Anyway, ax_gcc_malloc_call should do that exact thing for you
behind the scenes. I think.


_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to