syntax error with the operand 'asm'

Submitted by franha
on February 1, 2006 - 1:27pm

Hi,

I use GCC 4.0.2 as a cross compiler(target:powerpc), and I have errors when I compile a simple c file witch contain the operand 'asm' used like that :

extern void __reset(void);

---reset.c----------------------------
#pragma section code_type ".reset"

#pragma force_active on
__declspec(section ".reset")

asm void reset(void);

asm void reset(void)
{
nofralloc
b __reset
}
#pragma force_active reset
---------------------------------

command line to compile: $ /gnutools/bin/powerpc-elf-eabi-gcc -c ../reset.c

the result of the compilation is :

../reset.c:6: error: syntax error before string co
../reset.c:10: error: syntax error before 'void'

are there any options to use GCC 4.0.2 ? I had not got this erreur with GCC 3.4.0!

Thanks in advance

Don't use 4.0.x

on
February 1, 2006 - 2:22pm

There is still lots of software out there that for one reason or another won't compile on gcc 4.0.x. So you can either go to v3.4.5 or expect to hit more things like this. Personally, I'm waiting for at least v4.1 before I make the move.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.