NetBSD Problem Report #49281

From www@NetBSD.org  Tue Oct 14 00:29:37 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7E857A6686
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 14 Oct 2014 00:29:37 +0000 (UTC)
Message-Id: <20141014002936.3AB45A668B@mollari.NetBSD.org>
Date: Tue, 14 Oct 2014 00:29:36 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: amd64 kernel config w/ppbus and "options DEBUG_1284" build fails with format error
X-Send-Pr-Version: www-1.0

>Number:         49281
>Category:       kern
>Synopsis:       amd64 kernel config w/ppbus and "options DEBUG_1284" build fails with format error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 14 00:30:00 +0000 2014
>Closed-Date:    Wed Dec 03 12:55:42 +0000 2014
>Last-Modified:  Wed Dec 03 13:05:00 +0000 2014
>Originator:     John D. Baker
>Release:        NetBSD/amd64-7.0_BETA (and 6.x)
>Organization:
>Environment:
NetBSD tesla.clamp.net 7.0_BETA NetBSD 7.0_BETA (GENERIC) #8: Mon Sep 29 19:49:05 CDT 2014  sysop@verthandi.technoskunk.fur:/d0/build/netbsd-7/obj/amd64/sys/arch/amd64/compile/GENERIC amd64

>Description:
Compiling a custom kernel with atppc/ppbus and "options DEBUG_1284"
fails as follows:

[...]
--- ppbus_base.o ---
/d0/nbsd/netbsd-7/src/sys/dev/ppbus/ppbus_base.c: In function 'ppbus_pnp_detect':
/d0/nbsd/netbsd-7/src/sys/dev/ppbus/ppbus_base.c:540:2: error: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Werror=format=]
  printf("%s: <PnP> %d characters: ", device_xname(dev), len);
  ^
cc1: all warnings being treated as errors
*** [ppbus_base.o] Error code 1

nbmake: stopped in /d0/build/netbsd-7/obj/amd64/sys/arch/amd64/compile/TESLA
1 error

nbmake: stopped in /d0/build/netbsd-7/obj/amd64/sys/arch/amd64/compile/TESLA

ERROR: Failed to make all in "/d0/build/netbsd-7/obj/amd64/sys/arch/amd64/compile/TESLA"
*** BUILD ABORTED ***


The referenced file/line is as follows:

539  #ifdef DEBUG_1284
540          printf("%s: <PnP> %d characters: ", device_xname(dev), len);
541          for (i = 0; i < len; i++)
542                  printf("%c(0x%x) ", str[i], str[i]);
543          printf("\n");
544  #endif

Firstly, I would question the use of "%d" (signed quantity) for
printing a size or length value.

Second, since this does not cause an error on i386, "size_t" would
seem to be compatible with "int" (32 bits) on that platform.

Presumedly, "size_t" is 64 bits on x86_64/amd64 (I'm lost in a sea of
typedefs tracking it down).

Is there a format specifier that will be interpreted correctly for
a variable of type "size_t" regardless of the underlying type?

>How-To-Repeat:
Create a kernel config for amd64 which includes:

  atppc* at <parent>
  ppbus* at atppc?
  options DEBUG_1284

Attempt to build said kernel.
>Fix:
Workaround:  don't use "options DEBUG_1284"

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49281 CVS commit: src/sys/dev/ppbus
Date: Mon, 13 Oct 2014 21:04:39 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Tue Oct 14 01:04:39 UTC 2014

 Modified Files:
 	src/sys/dev/ppbus: ppbus_base.c

 Log Message:
 PR/49281: John D. Baker: fix debugging format
 XXX: pullup 7


 To generate a diff of this commit:
 cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ppbus/ppbus_base.c

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

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/49281: amd64 kernel config w/ppbus and "options DEBUG_1284"
 build fails with format error
Date: Tue, 14 Oct 2014 07:10:12 -0500 (CDT)

 And pullup-6, please.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49281 CVS commit: [netbsd-7] src/sys/dev/ppbus
Date: Mon, 10 Nov 2014 19:53:50 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Nov 10 19:53:50 UTC 2014

 Modified Files:
 	src/sys/dev/ppbus [netbsd-7]: ppbus_base.c

 Log Message:
 Pull up following revision(s) (requested by snj in ticket #206):
 	sys/dev/ppbus/ppbus_base.c: revision 1.20
 PR/49281: John D. Baker: fix debugging format
 XXX: pullup 7


 To generate a diff of this commit:
 cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/dev/ppbus/ppbus_base.c

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

From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49281 CVS commit: [netbsd-6] src/sys/dev/ppbus
Date: Wed, 3 Dec 2014 12:49:37 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Wed Dec  3 12:49:37 UTC 2014

 Modified Files:
 	src/sys/dev/ppbus [netbsd-6]: ppbus_base.c

 Log Message:
 Pull up following revision(s) (requested by snj in ticket #1190):
 	sys/dev/ppbus/ppbus_base.c: revision 1.20
 PR/49281: John D. Baker: fix debugging format
 XXX: pullup 7


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.10.1 src/sys/dev/ppbus/ppbus_base.c

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

State-Changed-From-To: open->closed
State-Changed-By: msaitoh@NetBSD.org
State-Changed-When: Wed, 03 Dec 2014 12:55:42 +0000
State-Changed-Why:
Fixed and pulled up.
Thanks.


From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49281 CVS commit: [netbsd-6-1] src/sys/dev/ppbus
Date: Wed, 3 Dec 2014 13:00:07 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Wed Dec  3 13:00:07 UTC 2014

 Modified Files:
 	src/sys/dev/ppbus [netbsd-6-1]: ppbus_base.c

 Log Message:
 Pull up following revision(s) (requested by snj in ticket #1190):
 	sys/dev/ppbus/ppbus_base.c: revision 1.20
 PR/49281: John D. Baker: fix debugging format
 XXX: pullup 7


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.24.1 src/sys/dev/ppbus/ppbus_base.c

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

From: "SAITOH Masanobu" <msaitoh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49281 CVS commit: [netbsd-6-0] src/sys/dev/ppbus
Date: Wed, 3 Dec 2014 13:00:39 +0000

 Module Name:	src
 Committed By:	msaitoh
 Date:		Wed Dec  3 13:00:39 UTC 2014

 Modified Files:
 	src/sys/dev/ppbus [netbsd-6-0]: ppbus_base.c

 Log Message:
 Pull up following revision(s) (requested by snj in ticket #1190):
 	sys/dev/ppbus/ppbus_base.c: revision 1.20
 PR/49281: John D. Baker: fix debugging format
 XXX: pullup 7


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.16.1 src/sys/dev/ppbus/ppbus_base.c

 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.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.