Re: undefined 'lseek' whem converting CW8->CW9
- From: Peter Paulus <peter.paulus@xxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Jul 2005 11:22:02 +0200
Alwyn wrote:
Excellent advice. That's my advice aswell. But since CodeWarrior since long has supported these non-standard functions, why should they suddenly discontinue that now (for fairly harmless functions)?In article <42db60c5$0$10607$4d4ebb8e@xxxxxxxxxxxxxx>, Peter Paulus <peter.paulus@xxxxxxxxxxxxxxxxx> wrote:
As far as I know strupr() was ever designed for UTF-8. It is not designed for Pascal strings either. But it could make perfect sense to (have) use(d) these functions. And then it is a real nuissance if they disappear because there is a compiler update.
As I understand it, the 'disappearance' is due to switching from PEF to Mach-O builds. To make the latter, you have to use what Apple provide.
Furthermore I believe that every programmer redoing these methods doesn't contribute to productivity. I don't see much sense in re-implementing functions that have been around for so many years.
If they need re-implementation, I guess Metrowerks should take care of that.
I don't see how Metrowerks can be expected to supplement Apple's System library with their own non-standard functions. I think it is good advice to keep to the C standard wherever possible.
Just out of (academic) curiosity; Does anybody know why, in the context of the ANSI C specification, strupr(), strlwr() and strcasecmp() are not supported. I guess almost all implementations are based on topupper() and tolower(), because that seems the most logical thing to do. So how come a function that is based entirely on a ANSI C standard call is not ANSI C standard compatible? What other code is violating so much that it could not be in the standard?
In CodeWarrior 8.3 implementation (MSL/MSL_Extras/MSL_Common/Src/extras.c):
char * _MSL_CDECL strupr(char *str){
char *temp = str; /*- mm 010116 -*/
while (*temp) /*- mm 010116 -*/
{
*temp= toupper(*temp); /*- mm 010116 -*/
temp++; /*- mm 010116 -*/
}
return str;
}char * _MSL_CDECL strlwr (char *string)
{
char *s = string;
while (*s)
{
*s = tolower (*s);
s++;
}return string; }
With kind regards, Peter Paulus
Alwyn
.
- References:
- undefined 'lseek' whem converting CW8->CW9
- From: brianhray@xxxxxxxxx
- Re: undefined 'lseek' whem converting CW8->CW9
- From: Josef W. Wankerl
- Re: undefined 'lseek' whem converting CW8->CW9
- From: brianhray@xxxxxxxxx
- Re: undefined 'lseek' whem converting CW8->CW9
- From: Alexey Proskuryakov
- Re: undefined 'lseek' whem converting CW8->CW9
- From: Peter Paulus
- Re: undefined 'lseek' whem converting CW8->CW9
- From: Alwyn
- undefined 'lseek' whem converting CW8->CW9
- Prev by Date: Re: undefined 'lseek' whem converting CW8->CW9
- Next by Date: Re: undefined 'lseek' whem converting CW8->CW9
- Previous by thread: Re: undefined 'lseek' whem converting CW8->CW9
- Next by thread: How do I get an FsRef for a file?
- Index(es):
Relevant Pages
|