delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/12/25/23:54:12

Date: Mon, 26 Dec 1994 13:27:14 +0900
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: TAUPIN AT rsovax DOT lps DOT u-psud DOT fr
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Pascal chr() and Fortran ICHAR() converted to C

   Subject: Pascal chr() and Fortran ICHAR() converted to C

Thank you for trying with the "Subject:" header!  Unfortunately, my
reader (and possibly others) don't pick it up, since it's in the
"text" portion of the message :-(  So maybe it's not worth your while
trying to work around your unfortunate mail software.  FYI.

   With bith p2c and f2c (recent versions) I find serieux problems in
   alphebetic sorting. O cours this does not happen with std ASCII
   chars, i.e.  less than 128, but for accented letters >= 128.

   Both f2c and p2c convert things like a:=ord('z') simpling by affecting
   the character 'a' to an integer. Unfortunately, if the character is
   above 127, then a sign extension occurs, giving a negative ord() or
   ICHAR().

   Is this a djgpp problem (unlikely) or a simultaneous bug both in
   f2c and p2c.  If the seond holds, corrections shold be posted and
   therefore welcome.

   D. Taupin

Presumably this can be fixed by recompiling the offending packages
with the appropriate flag.  ("-funsigned-char" should compile all
characters as unsigned.)  If so, it is a GCC (not DJGPP only) problem,
at least for those platforms that default to signed characters.
    Unfortunately, this might break something elsewhere; I have no
idea whether some well-meaning fool decided to use signed characters
to hold very small integers for some reason.  You could try
recompiling p2c and f2c with that flag; if it's not a library problem,
then adding "-funsigned-char" to the PASCALFLAGS (or whatever it might
be; I don't use those programs) for gcc in the makefile for your
application might do it.
    --Steve



- Raw text -


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