Welcome to MacForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

MPW/Carbon build crashes in qsort()

 
   Macintosh computer (Home) -> Tools RSS
Next:  Tools: Java development on OS X; XCode vs The World.  
Author Message
toby

External


Since: Feb 17, 2005
Posts: 76



(Msg. 1) Posted: Wed Aug 24, 2005 11:50 am
Post subject: MPW/Carbon build crashes in qsort()
Archived from groups: comp>sys>mac>programmer>tools (more info?)

I get an EXC_BAD_INSTRUCTION entering qsort() in a program built with
mrc/ppclink, when run under OS X/Carbon. A typical invocation:

int c(const void *a, const void *b){ return (*(int*)a)-(*(int*)b); }
qsort(a, 10, sizeof(int), c);

A corresponding "classic" build does not crash.

Can anyone shed any light on this? I cannot use Xcode/gcc as a PEF
executable is required (plugin). CodeWarrior build would probably work
around the problem but MPW is preferable.

--Toby


Makefile snippet:

LIBS_CLASSIC = ∂
"{SharedLibraries}InterfaceLib" ∂
"{SharedLibraries}StdCLib" ∂
"{SharedLibraries}MathLib" ∂
"{SharedLibraries}NavigationLib" ∂
"{SharedLibraries}AppearanceLib" ∂
"{SharedLibraries}WindowsLib" ∂
"{SharedLibraries}ControlsLib" ∂
"{PPCLibraries}StdCRuntime.o" ∂
"{PPCLibraries}PPCCRuntime.o" ∂
#"{PPCLibraries}PPCToolLibs.o" ∂
#"{PPCLibraries}"CarbonAccessors.o

LIBS_CARBON = ∂
"{SharedLibraries}CarbonLib" ∂
"{SharedLibraries}StdCLib" ∂
"{PPCLibraries}PPCCRuntime.o"

COPT = -opt speed -tb on -w 2,35
COPTEXTRA = -d MAC_ENV {ACCESSPATHS} -proto strict

PPCLINKOPTS = -t {PLUGINTYPE} -c {PLUGINCREATOR} -m main
....
..ca.x ƒ .c # Carbon PowerPC object
mrc {depdir}{default}.c -o {targ} {COPT} {COPTEXTRA} -d TARGET_CARBON
..cl.x ƒ .c # Classic PowerPC object
mrc {depdir}{default}.c -o {targ} {COPT} {COPTEXTRA}

{EXEC_CLASSIC} ƒƒ {OBJ_CLASSIC}
PPCLink -o {Targ} {PPCLINKOPTS} {OBJ_CLASSIC} {LIBS_CLASSIC}
{EXEC_CARBON} ƒƒ {OBJ_CARBON}
PPCLink -o {Targ} {PPCLINKOPTS} -d {OBJ_CARBON} {LIBS_CARBON}

 >> Stay informed about: MPW/Carbon build crashes in qsort() 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> Tools All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]