Bug 86884 - Fix f2c to work on 64 bit platforms
Summary: Fix f2c to work on 64 bit platforms
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Simon Barner
Depends on:
Reported: 2005-10-04 09:20 UTC by Charlie Root
Modified: 2005-10-05 08:02 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Root 2005-10-04 09:20:25 UTC

Fix: Use specific width types in f2c.h to handle assumptions about width.

#ifndef F2C_INCLUDE
 #define F2C_INCLUDE
+#include <sys/types.h>

-typedef long int integer;
-typedef unsigned long int uinteger;
+typedef int32_t integer;
+typedef uint32_t uinteger;
 typedef char *address;
 typedef short int shortint;
 typedef float real;
 typedef double doublereal;
 typedef struct { real r, i; } complex;
 typedef struct { doublereal r, i; } doublecomplex;
-typedef long int logical;
+typedef int32_t logical;
 typedef short int shortlogical;
 typedef char logical1;
 typedef char integer1;
 #ifdef INTEGER_STAR_8  /* Adjust for integer*8. */
-typedef long long longint;             /* system-dependent */
-typedef unsigned long long ulongint;   /* system-dependent */
+typedef int64_t longint;               /* system-dependent */
+typedef uint64_t ulongint;     /* system-dependent */
 #define qbit_clear(a,b)        ((a) & ~((ulongint)1 << (b)))
 #define qbit_set(a,b)  ((a) |  ((ulongint)1 << (b)))
@@ -42,9 +43,9 @@
 typedef short ftnlen;
 typedef short ftnint;
-typedef long int flag;
-typedef long int ftnlen;
-typedef long int ftnint;
+typedef int32_t flag;
+typedef int32_t ftnlen;
+typedef int32_t ftnint;

 /*external read, write*/--CnxgWDLns7BU2WuBv9j79N3OvPc0ANVSt443VjpFGwkaJh6y
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- f2c.h.orig  Tue Oct  4 05:38:52 2005
+++ f2c.h       Tue Oct  4 08:05:43 2005
@@ -6,22 +6,23 @@
Comment 1 Simon Barner freebsd_committer 2005-10-04 18:21:41 UTC
Responsible Changed
From-To: freebsd-ports-bugs->barner

Comment 2 Simon Barner freebsd_committer 2005-10-04 18:46:16 UTC

AFAICS, this fixes runtime errors, right? The port builds without the
patch, so I'll bump PORTREVISION in order to get the package rebuilt.

Best regards / Viele Grüße,                             barner@FreeBSD.org
 Simon Barner                                                barner@gmx.de
Comment 3 Charlie Root 2005-10-05 01:45:00 UTC
On Wednesday 05 October 2005 03:16, Simon Barner wrote:
> AFAICS, this fixes runtime errors, right? The port builds without the
> patch, so I'll bump PORTREVISION in order to get the package rebuilt.

Without the port everything builds but things seg fault/bus error.

I haven't done extensive testing but I believe the patch makes f2c correct for 
32 and 64 bit platforms (although no idea about big endian ones)

Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Comment 4 Simon Barner freebsd_committer 2005-10-05 08:02:56 UTC
State Changed
From-To: open->closed

Committed. Thanks!