delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/30/18:30:16.1

From: eglebbk AT dds DOT nl (Evert Glebbeek)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BAD strupr, BAD getw
Date: Wed, 30 Aug 2000 22:14:30 GMT
Organization: Physics student, University of Amsterdam
Lines: 43
Distribution: world
Message-ID: <39a9a972.29351296@news.wins.uva.nl>
References: <ue4cqsg0k83m0461605mnkssjo43odacen AT 4ax DOT com>
NNTP-Posting-Host: stol-117-217.uva.studentennet.nl
X-Trace: info.wins.uva.nl 967673742 24663 145.98.117.217 (30 Aug 2000 22:15:42 GMT)
X-Complaints-To: usenet AT science DOT uva DOT nl
NNTP-Posting-Date: Wed, 30 Aug 2000 22:15:42 +0000 (UTC)
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Newsgroup: comp.os.msdos.djgpp
 From: Radical NetSurfer <radsmail AT juno DOT com>
 On Fri, 25 Aug 2000 02:44:18 -0400

>Tonight we had to create our very own code for
>
>strupr
>
>simply because DJGPP does NOT implement this function
>correctly at ALL :(

It's not ANSI/POSIX, so you shouldn't be counting on it being portable
in the first place.

>2) an ACCURATE and properly implemented method of ACTUALLY
>converting Upper/Lower FOREIGN character set should be implemented.
>(ah, Mr. Wizard, sir, how do we know an ASCII char represents a
>foreign character, please?)

Portable programs shouldn't be assuming an ASCII character set. IMHO,
the point of programming in C is to actually produce portable code.

>also,  getw is defined in LIBC.TXT as:
>
>int getw(FILE *file);
>
>this is INCORRECT!

Since getw() isn't ANSI or POSIX either, it's not incorrect.
>
>get-WORD()  should of been defined as:
>
>short getw(FILE*);
>
>as a WORD is "typically/natively" DEFINED AS 16-BIT!

This is not true.

>When did a WORD become PLATFORM SPECIFIC?

It always has been. A word is simply the machines most natural native
representation of an integer, which corresponds to C's int type. So
int getw() is entierly correct.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019