www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/11/04/13:13:22

Date: Thu, 4 Nov 93 11:15 CST
From: khc AT eece DOT ksu DOT edu (Kenneth H. Carpenter)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Compiling f2c with djgpp

In a recent post to this list, Jim Lupo gave instructions for
compiling f2c using djgpp.  In attempting to do this myself with
the latest f2c sources, I ran into the following error on the file
"close.c" in "libI77":
  "close.c" contains the lines,
      #include "f2c.h"
      #include "fio.h"
      
  "fio.h" contains the line,
      #include "errno.h"

"errno.h" is from the djgpp include subdirectory.
  "errno.h" contains the line,
      #include <std.h>

There is a conflict between "f2c.h" and "std.h" in the definition
of "abs".  In "f2c.h" one has:
      #define abs(x) ((x) >= 0 ? (x) : -(x))

while in "std.h" one has:
      int abs(int);

Thus when compiling, one gets a parse error at line 50 in "std.h".

Is the correct fix to remove the definition from "f2c.h", or from "std.h"?

(Note:  I am using djgpp 1.09, which has gcc -version give 2.2.2.
        I do not see how the combination above could avoid an error
        with any version, since it would be processing
        "int (int) >= 0 ? (int) : -(int);"
)

- Raw text -


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