Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Asm blocks not working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asm blocks not working?




On Jul 9, 2005, at 13:44 , Jeremy Sagan wrote:

I cannot get asm blocks to work at all with xcode 2.1. Included is an example. I get the same result with any file that contains an asm block. I cannot understand why I would get the error "error: 'asm' undeclared (first use in this function)" as seen below. I have codewarrior style asm blocks checked in my target and "-fasm- blocks" clearly appears in the gcc 4.0 parameter list.

Obviously the asm code written below is not good but I am just trying to get the asm blocks to work with GCC 4.0. Why do asm blocks not work for me?

Because you've done something to annoy someone with more power than you?

Seriously, when faced with this, I try something simple:

$ cc -c foo.c
foo.c: In function 'asmTest':
foo.c:5: error: asm blocks not enabled, use `-fasm-blocks'
foo.c:6: error: 'srawi' undeclared (first use in this function)
foo.c:6: error: (Each undeclared identifier is reported only once
foo.c:6: error: for each function it appears in.)
foo.c:6: error: parse error before 'temp'

OK, I take the hint:

$ cc -c foo.c -fasm-blocks
$

So looking at your compile line, something has to be overriding -fasm- blocks. Could it be ...

CompileC "build/Metro.build/Imported CodeWarrior Settings/Metro SE Debug.build/Objects-normal/ppc/asmtest.o" ../Source/asmtest.c normal ppc c com.apple.compilers.gcc.4_0
mkdir "/Volumes/Itchy/Development/MetroC/Metro6.3.1XC/ MetroMachO/build/Metro.build/Imported CodeWarrior Settings/Metro SE Debug.build/Objects-normal/ppc"
cd /Volumes/Itchy/Development/MetroC/Metro6.3.1XC/MetroMachO
setenv MACOSX_DEPLOYMENT_TARGET 10.2
/usr/bin/gcc-4.0 -x c -arch ppc -pipe

this?

-std=c99

cc -c foo.c -fasm-blocks -std=c99 foo.c: In function 'asmTest': foo.c:5: error: 'asm' undeclared (first use in this function) foo.c:5: error: (Each undeclared identifier is reported only once foo.c:5: error: for each function it appears in.) foo.c:5: error: parse error before '{' token

Betcha c99 doesn't include support for 'asm'.

Cheers,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
Men are from Earth.
Women are from Earth.
   Deal with it.
--------


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Asm blocks not working? (From: Jeremy Sagan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.