blob: 0bfe3a864f4e33cd8dd812d35f5edcdbe0e5e052 [file] [log] [blame]
Mike Dodd8cfa7022010-11-17 11:12:26 -08001dnl 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)