NASM Forum > Using NASM

error: `%define' expects a macro identifier error starting with NASM 2.15rc1

(1/1)

uyjulian:
The following doesn't work anymore:

--- Code: ---%define %$%1 %2

--- End code ---
Minimized test case:

--- Code: ---%imacro globaldef 1
%define %1 _%1
global %1
%endmacro


%define segment_code segment .text
%macro function_align 0
segment_code
align 4
%endmacro


%macro proc_start 1
%push %1
function_align
%1:
%define %$stack_restore
%assign %$arg_base 28
%assign %$var_base 4
push edi
push esi
push ebx
push ecx
push edx
push ebp
mov ebp, esp
%endmacro


%macro proc_name_def 2
; VVV ISSUE CODE
%define %$%1 %2
; ^^^ ISSUE CODE
%endmacro


%macro proc_arg 2
proc_name_def %2, ebp+%$arg_base
%assign %$arg_base %$arg_base+%1
%endmacro


globaldef test_func

function_align
proc_start test_func
proc_arg 4, test_arg


--- End code ---
In nasm 2.15rc1, the following occurs:

--- Code: ---min.nas:49: error: `%define' expects a macro identifier
min.nas:40: ... from macro `proc_arg' defined here
min.nas:35: ... from macro `proc_name_def' defined here

--- End code ---
The sample test case above assembles successfully with nasm 2.14.03rc2. Possible regression?

Frank Kotler:
Hi uyjulian,

Welcome to the forum.

Bug reports might be better filed with:
https://bugzilla.nasm.us/

Have you tried it with a space in it?

Best,
Frank


uyjulian:
I have tried with a space, and it still does the same thing:
%define %$ %1 %2

I created the bug here: https://bugzilla.nasm.us/show_bug.cgi?id=3392722

Navigation

[0] Message Index

Go to full version