NetBSD Problem Report #55807

From o.vd.linden@quicknet.nl  Mon Nov 16 16:35:50 2020
Return-Path: <o.vd.linden@quicknet.nl>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 60F051A921F
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 16 Nov 2020 16:35:50 +0000 (UTC)
Message-Id: <20201116151645.GA10487@sheep>
Date: Mon, 16 Nov 2020 16:16:45 +0100
From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@NetBSD.org
Subject: libexec/identd/npf.c fails to compile on -current

>Number:         55807
>Category:       bin
>Synopsis:       libexec/identd/npf.c fails to compile on -current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 16 16:40:00 +0000 2020
>Closed-Date:    Mon Nov 16 16:56:53 +0000 2020
>Last-Modified:  Mon Nov 16 16:56:53 +0000 2020
>Originator:     Onno van der Linden
>Release:        NetBSD 9.99.75
>Organization:
>Environment:
System: NetBSD sheep 9.99.75 NetBSD 9.99.75 (SHEEPKMS) #0: Sat Nov 14 12:22:46 CET 2020 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEPKMS i386
Architecture: i386
Machine: i386
>Description:
#   compile  identd/npf.o
/usr/tools/bin/i486--netbsdelf-gcc -O2   -fPIE -fno-strict-aliasing   -std=gnu99    -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare  -Wsystem-headers   -Wno-traditional   -Wa,--fatal-warnings  -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wold-style-definition -Wsign-compare -Wformat=2  -Wno-format-zero-length  -Werror     --sysroot=/ -DWITH_IPF -DWITH_PF -DWITH_NPF  -c    /usr/src/libexec/identd/npf.c
/usr/src/libexec/identd/npf.c: In function 'npf_natlookup':
/usr/src/libexec/identd/npf.c:65:21: error: taking address of packed member of 'struct sockaddr_in' may result in an unaligned pointer value [-Werror=address-of-packed-member]
   65 |   addr[0] = (void *)&satosin(nat_addr)->sin_addr;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/src/libexec/identd/npf.c:32:
/usr/src/libexec/identd/npf.c:66:23: error: taking address of packed member of 'struct sockaddr_in' may result in an unaligned pointer value [-Werror=address-of-packed-member]
   66 |   addr[1] = __UNCONST(&csatosin(&ss[1])->sin_addr);
      |                       ^
cc1: all warnings being treated as errors
*** Error code 1

Stop.
make: stopped in /usr/src/libexec/identd
>How-To-Repeat:
Compile identd/npf.c on -current with gcc 9.3.0
>Fix:
Don't use -Werror=address-of-packed-member but that seems
sticking your head in the sand to me

>Release-Note:

>Audit-Trail:
From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/55807: libexec/identd/npf.c fails to compile on -current
Date: Mon, 16 Nov 2020 17:52:41 +0100

 This one can be closed. Forgot to install the new mk files
 that know how to handle

 CWARNFLAGS.gcc+=        ${GCC_NO_ADDR_OF_PACKED_MEMBER}

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 16 Nov 2020 16:56:53 +0000
State-Changed-Why:
Closing on submitters request


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.