This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Macro causes an error


> I've declared some macros, but it want not work, don't
> know why. The preprocessor produces correct code.
> Im using gcc version 3.1 20020415 (prerelease).
> 

> Compiler output: 6: parse error before ':' token

> int a;
> 
>  asm("\t.text\n" "\t.align 2\n" ".globl _" "PAGE_FAULT_HANDLER" "\n" 
>      "_" "PAGE_FAULT_HANDLER" ":\n"
>      "\tmov eax,1\n"
>      "\tiret " "4" "\n" :"=r"(a));
> 
> ----
> 
> What is the problem here?

You aren't inside a function body, so you can't use a register spec inside 
the ASM.

GCC is not a macro assembler -- why are you trying to use it as one?

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]