mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-30 16:41:05 +08:00
configure: make sure we flag invalid attributes
Use -Werror=attributes so we can actually test for non-supported attributes without spewing warnings. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
3fa2558a69
commit
bc18af18f0
2
aclocal.m4
vendored
2
aclocal.m4
vendored
@ -63,6 +63,7 @@ AC_DEFUN(PA_FUNC_ATTRIBUTE,
|
||||
#include <stdarg.h>
|
||||
extern ifelse([$3],[],[void *],[$3]) __attribute__(($1$2))
|
||||
bar(ifelse([$4],[],[int],[$4]));
|
||||
void *foo(void);
|
||||
void *foo(void)
|
||||
{
|
||||
return bar(ifelse([$5],[],[1],[$5]));
|
||||
@ -86,6 +87,7 @@ AC_DEFUN(PA_FUNC_ATTRIBUTE_ERROR,
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <stdarg.h>
|
||||
extern void __attribute__((error("message"))) barf(void);
|
||||
void foo(void);
|
||||
void foo(void)
|
||||
{
|
||||
if (0)
|
||||
|
@ -137,6 +137,7 @@ dnl Check for supported gcc attributes; some compilers (e.g. Sun CC)
|
||||
dnl support these, but don't define __GNUC__ as they don't support
|
||||
dnl some other features of gcc.
|
||||
dnl
|
||||
PA_ADD_CFLAGS([-Werror=attributes])
|
||||
PA_FUNC_ATTRIBUTE(noreturn)
|
||||
PA_FUNC_ATTRIBUTE(returns_nonnull)
|
||||
PA_FUNC_ATTRIBUTE(malloc)
|
||||
|
Loading…
Reference in New Issue
Block a user