This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Macro causes an error
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: "Ben. K." <bkausbk at web dot de>
- Cc: gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Thu, 18 Apr 2002 10:48:53 +0100
- Subject: Re: Macro causes an error
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> 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.