problem compiling libf2c/libI77 library on c4x
Herman ten Brugge
Haj.Ten.Brugge@net.HCC.nl
Mon Jun 5 09:00:00 GMT 2000
Hello,
I found a problem in the rdfmt.c library file in the libf2c/libI77
directory. On the c4x sizeof(char) == sizeof(short). This makes the
case statement fail. I changed the case statement into an if-then-else
sequence to solve the problem.
Herman.
2000-06-01 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* rdfmt.c (rd_L): Use if-then-else instead of case statement to
solve problems when sizeof(char) == sizeof(short).
--- rdfmt.c.org Thu Jun 1 15:54:45 2000
+++ rdfmt.c Thu Jun 1 15:54:48 2000
@@ -208,11 +208,12 @@ rd_L(ftnint *n, int w, ftnlen len)
case '\n':
return errno = 116;
}
- switch(len) {
- case sizeof(char): *(char *)n = (char)lv; break;
- case sizeof(short): *(short *)n = (short)lv; break;
- default: *n = lv;
- }
+ if (len == sizeof(char))
+ *(char *)n = (char)lv;
+ else if (len == sizeof(short))
+ *(short *)n = (short)lv;
+ else
+ *n = lv;
while(w-- > 0) {
GET(ch);
if (ch == ',' || ch == '\n')
More information about the Gcc-patches
mailing list