P
prix prad
Hi All,
I encountered the above error when I tried to expand a macro
as follows:
#define EXPAND(array) int M_ ## array
The problem occurs when we have 'array' itself as a macro:
say EXPAND(ARR(DECL))
where #define DECL _decl
#define ARR(name) arr ## name
So the end result would be M_arr_name
The error goes away when I do:
#define EXPAND(array) int PREPEND_ARR(array)
where
PREPEND_ARR(array) M_ ## array
Can someone explain me why the error is about a 'function declaration'
in this case since we are dealing with MACROS?
Thanks,
/prix
I encountered the above error when I tried to expand a macro
as follows:
#define EXPAND(array) int M_ ## array
The problem occurs when we have 'array' itself as a macro:
say EXPAND(ARR(DECL))
where #define DECL _decl
#define ARR(name) arr ## name
So the end result would be M_arr_name
The error goes away when I do:
#define EXPAND(array) int PREPEND_ARR(array)
where
PREPEND_ARR(array) M_ ## array
Can someone explain me why the error is about a 'function declaration'
in this case since we are dealing with MACROS?
Thanks,
/prix