NetBSD Problem Report #50997

From www@NetBSD.org  Thu Mar 24 11:36:08 2016
Return-Path: <www@NetBSD.org>
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 484F87ABDA
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 24 Mar 2016 11:36:08 +0000 (UTC)
Message-Id: <20160324113559.CDA0B7ACAD@mollari.NetBSD.org>
Date: Thu, 24 Mar 2016 11:35:59 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/bin/ls/ls.c: 4 * bad % specifiers ?
X-Send-Pr-Version: www-1.0

>Number:         50997
>Category:       bin
>Synopsis:       src/bin/ls/ls.c: 4 * bad % specifiers ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 24 11:40:00 +0000 2016
>Closed-Date:    Mon May 30 17:36:29 +0000 2016
>Last-Modified:  Mon May 30 17:36:29 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160324
>Organization:
>Environment:
>Description:

src/bin/ls/ls.c:634]: (warning) %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'signed long long'.

            (void)snprintf(buf, sizeof(buf), "%llu",
                (long long)howmany(maxblock, blocksize));

Suggest remove the cast, find out the return type of howmany
and use a suitable % specifier for that type.


src/bin/ls/ls.c:650]: (warning) %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'signed long long'.
src/bin/ls/ls.c:658]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'int'.
[src/bin/ls/ls.c:660]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Duplicates.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50997 CVS commit: src/bin/ls
Date: Mon, 30 May 2016 17:26:29 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Mon May 30 17:26:29 UTC 2016

 Modified Files:
 	src/bin/ls: ls.c

 Log Message:
 PR 50997 David Binderman: fix format strings


 To generate a diff of this commit:
 cvs rdiff -u -r1.74 -r1.75 src/bin/ls/ls.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: dholland@NetBSD.org
State-Changed-When: Mon, 30 May 2016 17:36:29 +0000
State-Changed-Why:
fixed, thanks


>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.