Re: probing for compiler attributes?

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

 



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.

-J

--

Attachment: pgpbR56G9r42z.pgp
Description: PGP signature

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

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux