delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/12/27/09:50:49

From: Paul Koning 1695 <pkoning AT chipcom DOT com>
To: djgpp mailing list <djgpp AT sun DOT soe DOT clarkson DOT edu>
Subject: alphabetic sorting
Date: Tue, 27 Dec 94 09:27:00 PST
Encoding: 25 TEXT

>Subject: alphabetic sorting solved
>Thanks to Stephem Turnbull (Tsukuba,jp) my alphabetic sorting problems
>with f2c are solved: I only had to recompile the f2c library
>with the -funsigned-char option.
>
>--> I advise everybody to have that option as a default, except
>when using chars to store 8-bit signed integers. Anyway, this seems
>required when using f2c or p2c.
>
>Daniel Taupin

That's a good workaround.  But as a matter of good programming
practice, you should always write explicitly "unsigned char" in your
declarations if you require that property.  (For that matter, given that
it's possible to have char default to unsigned, you should ALSO write
"signed char" explicitly in the unlikely event that you require THAT
property.)  The fact that f2c doesn't do this is clearly a bug in that
program.

Then again, one could also argue that the type system of C sucks.
So what else is new?  You want real data types, use Modula.

     paul
     (pkoning AT chipcom DOT com)

- Raw text -


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