Date: Mon, 26 Dec 1994 13:27:14 +0900 From: Stephen Turnbull 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