Yes... My functions are allocating memory and using to work with some strings... so at the end of the function I have the value that I want in the memory so I am trying to return the pointer but it's not working in GCC, but works in CW6. I've changed the initialization of the phone variable to char *phone="" and now the "bus error" occurs just in the return instruction. The error says that the application accessed a memory location that is not in RAM or ROM, nor corresponds to a memory- mapped hardware register.
> > > I take it that your functions ReturnTextInvert and Retu rnDecByChar are > allocating memory, and returning a pointer? > > Alan > > "Davi Lopes Carvalho" <[EMAIL PROTECTED]> wrote in me ssage > news:[EMAIL PROTECTED] > > The problem is I hava a code here that works when > compiling with CodeWarrior but not works when compiling > with GCC. With GCC occurrs one "bus error" in the > emulator and in the palm occurrs a Fatal Exception. I > think that the problem is in this function: > > static char *ReturnFormatFone(char *fone) > { > char *phone; > char n1[1]; > char n2[1]; > char *PtrPh; > char *dig; > int i; > > phone=ReturnTextInvert(ReturnDDD()); > > i=0; > do{ > n1[1]=fone[i]; > n2[1]=fone[i+1]; > dig=ReturnDecByChar(n2[1], n1[1]); > PtrPh=MemPtrNew(StrLen(phone) + StrLen(dig) + > 1); //The error ocurrs right here... > StrCopy(PtrPh, phone); > StrCat(PtrPh, dig); > phone=PtrPh; > i=i+2; > } > while (i<=StrLen(fone)-2); > > return phone; > } > > Any of you knows a solution for this?! Remeber that thi s > error occurs just when compiling with GCC. With > CodeWarrior this application works normally. > > Thanks, > Davi Carvalho > > > > Any of you know how to convert a code warrior proje ct > to > > > a gcc one? > > > > if the codewarrior project does not use pilrc resourc es > , you have to > > recreate them or use some third party tool (for examp le > falch.net) to import > > the cw resources. you don't have to change the code, on > ly if there's asm > > code or #pragmas. if it is a big project, you may als o > have to split the > > code into sections (segments). > > > > markus dresch (www.palmside.com) > > > > > > > > -- > > For information on using the Palm Developer Forums, o r > to unsubscribe, please see http://www.palmos.com/dev/su pp ort/forums/ > > > > > _______________________________________________________ ___________________ > Acabe com aquelas janelinhas que pulam na sua tela. > AntiPop-up UOL - � gr�tis! > http://antipopup.uol.com.br/ > > > > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, > please see http://www.palmos.com/dev/support/forums/ > > > _________________________________________________________ _________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - � gr�tis! http://antipopup.uol.com.br/ __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - � gr�tis! http://antipopup.uol.com.br/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
