[Nasm-devel] Compilation fails on master branch

KO Myung-Hun komh78 at gmail.com
Mon Apr 1 05:14:14 PDT 2024


Hi/2.

I've tried to compile on master branch. However, it failed due to
`ATTRIBUTE', which seems to be a macro, like:

-----
gcc -c -std=c17 -Werror=attributes -g -O2 -fwrapv
-ftrivial-auto-var-init=zero -U__STRICT_ANSI__ -fno-common
-Werror=attributes -Wall -W -pedantic -Wc90-c99-compat -Wno-long-long
-Wno-stringop-truncation -Wno-shift-negative-value -Werror=implicit
-Werror=missing-braces -Werror=return-type -Werror=trigraphs
-Werror=pointer-arith -Werror=strict-prototypes
-Werror=missing-prototypes -Werror=missing-declarations -Werror=comment
-Werror=vla -DHAVE_CONFIG_H -I. -I. -I./include -I./include -I./x86
-I./x86 -I./asm -I./asm -I./disasm -I./disasm -I./output -I./output -o
stdlib/snprintf.o stdlib/snprintf.c
In file included from ./include/compiler.h:58,
                 from asm/nasm.c:38:
./config/config.h:851:22: error: function declaration isn't a prototype
[-Werror=strict-prototypes]
  851 | #  define never_null ATTRIBUTE(returns_nonnull)
      |                      ^~~~~~~~~
./include/compiler.h:303:24: note: in expansion of macro 'never_null'
  303 | #define safe_alloc     never_null     malloc_func
      |                        ^~~~~~~~~~
./include/compiler.h:306:33: note: in expansion of macro 'safe_alloc'
  306 | #define safe_malloc(s)          safe_alloc     alloc_size_func1(s)
      |                                 ^~~~~~~~~~
./include/nasmlib.h:64:8: note: in expansion of macro 'safe_malloc'
   64 | void * safe_malloc(1) nasm_malloc(size_t);
      |        ^~~~~~~~~~~
./include/nasmlib.h: In function 'ATTRIBUTE':
./config/config.h:867:23: error: expected declaration specifiers before
'ATTRIBUTE'
  867 | #  define malloc_func ATTRIBUTE(malloc)
      |                       ^~~~~~~~~
[...]
-----

If I define `ATTRIBUTE(x)=__attribute__((x))', all the problems go away.

I'm using gcc v12.3.0.

What's the problem ?

-- 
KO Myung-Hun

Korean OS/2 User Community : https://www.os2.kr/


More information about the Nasm-devel mailing list