pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/libfetch net/libfetch: Fix for gcc4.7



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2c241dc34dba
branches:  trunk
changeset: 609608:2c241dc34dba
user:      marino <marino%pkgsrc.org@localhost>
date:      Sun Oct 07 07:23:21 2012 +0000

description:
net/libfetch: Fix for gcc4.7

When building with gcc4.7, libfetch fails with the following error:
  ftp.c: In function 'unmappedaddr':
  ftp.c:149:2: error: dereferencing type-punned pointer will break
               strict-aliasing rules [-Werror=strict-aliasing]
  cc1: all warnings being treated as errors
  *** Error code 1

The code is intentionally grouping an array of four uint8_t bytes into a
uint32_t word.  Add -Wno-strict-aliasing in makefile to fix build in gcc4.7.

diffstat:

 net/libfetch/Makefile |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 1f2994ec445b -r 2c241dc34dba net/libfetch/Makefile
--- a/net/libfetch/Makefile     Sun Oct 07 07:01:50 2012 +0000
+++ b/net/libfetch/Makefile     Sun Oct 07 07:23:21 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2011/12/17 00:12:29 sbd Exp $
+# $NetBSD: Makefile,v 1.42 2012/10/07 07:23:21 marino Exp $
 #
 
 DISTNAME=      libfetch-2.33
@@ -19,6 +19,11 @@
 
 MAKE_JOBS_SAFE=                NO
 
+# GCC4.7 detects the intentional type-punned pointer dereference on ftp.c:149
+# libfetch is built with -Werror, so this strict-alias rule violation breaks
+# the build.  Disable the check.
+CFLAGS+=               -Wno-strict-aliasing
+
 .include "../../mk/bsd.prefs.mk"
 .if !empty(FETCH_USING:Mfetch)
 CHECK_PERMS=           no



Home | Main Index | Thread Index | Old Index