Re: undefined 'lseek' whem converting CW8->CW9



Alwyn wrote:
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.

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)?

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
.



Relevant Pages

  • Re: newbe: documentation string length
    ... as it addresses a reasonable goal state for a standard. ... with the Iraq war in that it's popular for the Bush camp over the last ... it hoping to make its meaning as apparent as possible, ... > The moral I'm minded to draw is that the ANSI ...
    (comp.lang.lisp)
  • Re: ANSI C compliance
    ... because I'm liable to be quoted out of context -- ANSI ... Several others have made this point, but even when portability is ... or for a million other but-what-difference-can-that-make reasons. ... Standard conformance is an instance of undefined behavior, ...
    (comp.lang.c)
  • ANSI C compliance
    ... "My boss would fire me if I wrote 100% ANSI C code" ... standard which is defined by an international committee. ... as intended on all platforms for which you have an ANSI C compiler, ... Writing truly standard C as valued by the "regulars" ...
    (comp.lang.c)
  • Re: Forth Frustrations
    ... called microFORTH, in the late 70's, primarily aimed at the hobbyist market. ... The big difference is that Forth83 was developed in only two 3-day meetings, 6 months apart, with somewhat differing membership, informal rules, and no official sanctioning body such as ANSI. ... The developers met 4 times a year, a total of 16 meeting days/year, in various parts of the country encouraging local Forthers to attend and voice their opinions. ... There were 4 drafts published for public review, and the standard was adopted in 1994 only after there were no more substantive changes resulting from the last review period. ...
    (comp.lang.forth)
  • de.comp.lang.c FAQ (Teil 3 von 5)
    ... Was ist der "ANSI-C Standard?" ... 1983 rief das American National Standards Institute (ANSI) ein Komitee namens X3J11 ins Leben mit der Aufgabe, ... Abschnitt 6: Der C Präprozessor ...
    (de.comp.lang.c)