NetBSD Problem Report #40123

From bernd@arresum.veego.de  Sat Dec  6 21:37:19 2008
Return-Path: <bernd@arresum.veego.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 9749A63BB94
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  6 Dec 2008 21:37:19 +0000 (UTC)
Message-Id: <200812062137.mB6Lb9W8022260@arresum.veego.de>
Date: Sat, 6 Dec 2008 22:37:09 +0100 (CET)
From: Bernd Ernesti <pr200825@veego.de>
Reply-To: Bernd Ernesti <pr200825@veego.de>
To: gnats-bugs@gnats.NetBSD.org
Subject: sysutils/file doesn't compile with gcc 3.3
X-Send-Pr-Version: 3.95

>Number:         40123
>Category:       pkg
>Synopsis:       sysutils/file doesn't compile with gcc 3.3
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 06 21:40:04 +0000 2008
>Closed-Date:    Sun Jan 25 12:31:59 +0000 2009
>Last-Modified:  Sun Jan 25 12:35:01 +0000 2009
>Originator:     Bernd Ernesti
>Release:        
>Organization:
>Environment:
>Description:
	gcc 3.3 doesn't support -Wextra:

 cc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/pkg/etc/magic:/usr/pkg/share/file/magic\" -I/usr/include -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -O2 -I/usr/include -MT magic.lo -MD -MP -MF .deps/magic.Tpo -c magic.c  -fPIC -DPIC -o .libs/magic.o
cc1: error: unrecognized option `-Wextra'
*** Error code 1

>How-To-Repeat:
	cd sysutils/file && make
>Fix:

>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/40123: sysutils/file doesn't compile with gcc 3.3
Date: Sun, 07 Dec 2008 10:33:39 +0900

 On Sun, 07 Dec 2008 06:40:04 +0900, Bernd Ernesti <pr200825@veego.de> wrote:

 >>Description:
 > 	gcc 3.3 doesn't support -Wextra:
 >
 >  cc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/pkg/etc/magic:/usr/pkg/share/file/magic\" -I/usr/include -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -O2 -I/usr/include -MT magic.lo -MD -MP -MF .deps/magic.Tpo -c magic.c  -fPIC -DPIC -o .libs/magic.o
 > cc1: error: unrecognized option `-Wextra'
 > *** Error code 1
 >
 >>How-To-Repeat:
 > 	cd sysutils/file && make
 >>Fix:

 Adding CONFIGURE_ARGS+=--disable-warnings is a workaround.


 mk/wrapper/transform-gcc pass through -Wextra unconditionally.
 Should it do following transforms?
   -Wextra ==> -W       if GCC3
   -W      ==> -Wextra  if GCC4

 -- 
 "Of course I love NetBSD":-)
 OBATA Akio / obache@NetBSD.org

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/40123: sysutils/file doesn't compile with gcc 3.3
Date: Sun, 25 Jan 2009 14:39:33 +0900

 On Sun, 07 Dec 2008 06:40:04 +0900, Bernd Ernesti <pr200825@veego.de> wrote:

 > 	gcc 3.3 doesn't support -Wextra:
 >
 >  cc -DHAVE_CONFIG_H -I. -I.. -DMAGIC=\"/usr/pkg/etc/magic:/usr/pkg/share/file/magic\" -I/usr/include -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wsign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -O2 -I/usr/include -MT magic.lo -MD -MP -MF .deps/magic.Tpo -c magic.c  -fPIC -DPIC -o .libs/magic.o
 > cc1: error: unrecognized option `-Wextra'
 > *** Error code 1

 Adding following lines to sysutils/file/Makefile may avoid this problem.

 .include "../../mk/compiler.mk"

 .if !empty(CC_VERSION:Mgcc-[23]*)
 BUILDLINK_TRANSFORM+=	rename:-Wextra:-W
 .endif


From: Bernd Ernesti <pr200825@veego.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/40123: sysutils/file doesn't compile with gcc 3.3
Date: Sun, 25 Jan 2009 11:08:03 +0100

 On Sun, Jan 25, 2009 at 05:40:03AM +0000, OBATA Akio wrote:
 [..]
 >  Adding following lines to sysutils/file/Makefile may avoid this problem.
 >  
 >  .include "../../mk/compiler.mk"
 >  
 >  .if !empty(CC_VERSION:Mgcc-[23]*)
 >  BUILDLINK_TRANSFORM+=	rename:-Wextra:-W
 >  .endif

 Yes, that avoids the problem.

 Bernd

State-Changed-From-To: open->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Sun, 25 Jan 2009 12:31:59 +0000
State-Changed-Why:
Commited the workaround.  Thanks for the PR and feedback!


From: OBATA Akio <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40123 CVS commit: pkgsrc/sysutils/file
Date: Sun, 25 Jan 2009 12:30:47 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Sun Jan 25 12:30:47 UTC 2009

 Modified Files:
 	pkgsrc/sysutils/file: Makefile

 Log Message:
 Rename -Wextra with -W if gcc-{2,3}, workaround of PR 40123.


 To generate a diff of this commit:
 cvs rdiff -r1.18 -r1.19 pkgsrc/sysutils/file/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.