mallocattribute.m4 revision 8cfa702f803c5ef6a2b062a489a1b2cf66b45b5e
1dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
2AC_DEFUN([AX_MALLOC_ATTRIBUTE],
3[
4AC_MSG_CHECKING([whether malloc attribute is understood])
5SAVE_CFLAGS=$CFLAGS
6CFLAGS="-Werror $CFLAGS"
7AC_TRY_COMPILE(,[
8void monkey() __attribute__((malloc));
9],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
10CFLAGS=$SAVE_CFLAGS 
11]
12)
13