This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
problem compiling libf2c/libI77 library on c4x
- To: gcc-patches at gcc dot gnu dot org
- Subject: problem compiling libf2c/libI77 library on c4x
- From: Herman ten Brugge <Haj dot Ten dot Brugge at net dot HCC dot nl>
- Date: Mon, 5 Jun 2000 18:01:06 +0100 (WEST)
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')