From 88ed7f2105dba7212743e9f86d4a40c4fd077447 Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 31 Jul 2010 20:31:33 +0000 Subject: Fix integer type misuse caught by gcc 4.4. PR 43291 from Makoto Fujiwara; the patches in the PR used unsafe (but less wrong) integer/pointer casts, so I did things somewhat differently. --- lang/f2c/Makefile | 4 ++-- lang/f2c/distinfo | 5 ++++- lang/f2c/patches/patch-al | 15 +++++++++++++++ lang/f2c/patches/patch-am | 19 +++++++++++++++++++ lang/f2c/patches/patch-an | 15 +++++++++++++++ 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 lang/f2c/patches/patch-al create mode 100644 lang/f2c/patches/patch-am create mode 100644 lang/f2c/patches/patch-an diff --git a/lang/f2c/Makefile b/lang/f2c/Makefile index 1cf3c2a4bfb..94fa891fa04 100644 --- a/lang/f2c/Makefile +++ b/lang/f2c/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.53 2010/01/03 01:37:59 tnn Exp $ +# $NetBSD: Makefile,v 1.54 2010/07/31 20:31:33 dholland Exp $ DISTNAME= f2c-20090411 # see notes below -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= lang MASTER_SITES= ${MASTER_SITE_LOCAL} diff --git a/lang/f2c/distinfo b/lang/f2c/distinfo index 8e3f402baf2..732d58a60f6 100644 --- a/lang/f2c/distinfo +++ b/lang/f2c/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.25 2009/12/23 00:48:20 asau Exp $ +$NetBSD: distinfo,v 1.26 2010/07/31 20:31:33 dholland Exp $ SHA1 (f2c-20090411.tar.gz) = 949e832b84aaa912a99471a95c6fd449898d50e0 RMD160 (f2c-20090411.tar.gz) = e86ff3de4564267a57f508a5a68e81af2b1a9468 @@ -6,3 +6,6 @@ Size (f2c-20090411.tar.gz) = 1045385 bytes SHA1 (patch-aa) = f1224ff17cdc96f083a247dce88b690e8b939eb0 SHA1 (patch-ad) = 7f204a45891e3632589ea8fb0e4e379a0a792dea SHA1 (patch-ak) = 8652a54df300ddd60d9b1a9594d312349b782cf4 +SHA1 (patch-al) = 9e06670ca6078c47f5cc6132f3f6158ec1757dc7 +SHA1 (patch-am) = 4be770f4ba34cfe7a3e6c27898e42ea6cb921128 +SHA1 (patch-an) = e4ec24f7b6203aa53d1d37848c9fd8a7b29b82dc diff --git a/lang/f2c/patches/patch-al b/lang/f2c/patches/patch-al new file mode 100644 index 00000000000..dbb4ed139ce --- /dev/null +++ b/lang/f2c/patches/patch-al @@ -0,0 +1,15 @@ +$NetBSD: patch-al,v 1.1 2010/07/31 20:31:33 dholland Exp $ + +PR 43291: integer type misuse caught by gcc 4.4 + +--- src/data.c.orig 2001-03-01 21:16:12.000000000 +0000 ++++ src/data.c +@@ -360,7 +360,7 @@ + k = elen - valp->vleng->constblock.Const.ci; + if(k > 0) { + dataline(varname, offset, TYBLANK); +- fprintf(dfile, "\t%d\n", k); ++ fprintf(dfile, "\t%d\n", (int) k); + } + break; + diff --git a/lang/f2c/patches/patch-am b/lang/f2c/patches/patch-am new file mode 100644 index 00000000000..00cee724f75 --- /dev/null +++ b/lang/f2c/patches/patch-am @@ -0,0 +1,19 @@ +$NetBSD: patch-am,v 1.1 2010/07/31 20:31:33 dholland Exp $ + +PR 43291: integer type misuse caught by gcc 4.4 + +--- src/format.c.orig 2003-03-20 18:34:13.000000000 +0000 ++++ src/format.c +@@ -2363,7 +2363,11 @@ p1get_const(FILE *infile, int type, stru + result->vstg = 1; + break; + case TYCHAR: +- status = fscanf(infile, "%lx", resultp); ++ { ++ void *tmp; ++ status = fscanf(infile, "%p", &tmp); ++ *resultp = tmp; ++ } + break; + default: + erri ("p1get_const: bad constant type '%d'", type); diff --git a/lang/f2c/patches/patch-an b/lang/f2c/patches/patch-an new file mode 100644 index 00000000000..6002e2fd93f --- /dev/null +++ b/lang/f2c/patches/patch-an @@ -0,0 +1,15 @@ +$NetBSD: patch-an,v 1.1 2010/07/31 20:31:33 dholland Exp $ + +PR 43291: integer type misuse caught by gcc 4.4 + +--- src/p1output.c.orig 2001-03-01 21:16:13.000000000 +0000 ++++ src/p1output.c +@@ -206,7 +206,7 @@ p1_const(register Constp cp) + if (vleng && !ISICON (vleng)) + err("p1_const: bad vleng\n"); + else +- fprintf(pass1_file, "%d: %d %lx\n", P1_CONST, type, ++ fprintf(pass1_file, "%d: %d %p\n", P1_CONST, type, + cpexpr((expptr)cp)); + break; + default: -- cgit v1.2.3