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

Bug#159804: marked as done (printf("%#Xll",x) can be funny)



Your message dated Sun, 3 Nov 2002 12:01:55 -0800
with message-id <20021103200155.GB25520@aokiconsulting.com>
and subject line Bug#159804: Suppliment (printf("%#Xll",x) can be funny)
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 6 Sep 2002 04:14:41 +0000
>From nospam@aokiconsulting.com Thu Sep 05 23:14:40 2002
Return-path: <nospam@aokiconsulting.com>
Received: from rwcrmhc51.attbi.com [204.127.198.38] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 17nAW0-0006bb-00; Thu, 05 Sep 2002 23:14:40 -0500
Received: from gateway.lan.aokiconsulting.com ([12.234.106.18])
          by rwcrmhc51.attbi.com
          (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP
          id <20020906041410.QFGU1399.rwcrmhc51.attbi.com@gateway.lan.aokiconsulting.com>
          for <submit@bugs.debian.org>; Fri, 6 Sep 2002 04:14:10 +0000
Received: from goofy.lan.aokiconsulting.com ([192.168.1.3])
	by gateway.lan.aokiconsulting.com with esmtp (Exim 3.35 #1 (Debian))
	id 17nAVT-0007yL-00
	for <submit@bugs.debian.org>; Thu, 05 Sep 2002 21:14:07 -0700
Received: from nospam by goofy.lan.aokiconsulting.com with local (Exim 3.35 #1 (Debian))
	id 17nAVS-0007f7-00
	for <submit@bugs.debian.org>; Thu, 05 Sep 2002 21:14:06 -0700
Date: Thu, 5 Sep 2002 21:14:06 -0700
From: Osamu Aoki <debian@aokiconsulting.com>
To: submit@bugs.debian.org
Subject: printf("%#Xll",x) can be funny
Message-ID: <20020906041406.GA29350@aokiconsulting.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
X-GPG-Fingerprint-old: 814E BD64 3288 40E7 E88E  3D92 C3F8 EA94 D5DE 453D
X-GPG-Fingerprint: 253A 4076 6A3B CCE2 A426  DEF5 E80F C4C1 A806 1F32
X-GPG-public-key-old: http://www.aokiconsulting.com/public-key
Sender: Osamu Aoki <nospam@aokiconsulting.com>
Delivered-To: submit@bugs.debian.org

Package: gcc
Version: 2.95.4-16
Severity: normal

This could be glibc error.  Following program did not act as I expected.

/*
 * type cast/formatting bug check for GCC / GLIBC
 * (C) Osamu Aoki, Mon Sep  2 17:51:30 UTC 2002
 */
#include <stdio.h>

int
main(int argc, char *argv)
{
	unsigned int b;
	unsigned long long int d; /* itry also unsigned long int  */
	b = 0xff;
	d = b;
	printf("Good %%X %%X %X %X\n", b, d);
	printf("Oops %%llX %%llX %llX %llX\n", b, d);
	printf("Oops %%llu %%llu %lli %llu\n", b, d);
	printf("Oops %%llX %%llX %llX %llX if casted to (unsigned int)\n", (unsigned int) b, (unsigned int) d);
	printf("Oops %%llX %%llX %llX %llX if casted to (unsigned long int)\n", (unsigned long int) b, (unsigned long int) d);
	printf("Oops %%lX %%lX %lX %lX if casted to (unsigned long long int)\n", (unsigned long long int) b, (unsigned long long int) d);
	printf("Good %%llX %%llX %llX %llX if casted to (unsigned long long int)\n", (unsigned long long int) b, (unsigned long long int) d);
	return(0);
};

---- 

Good %X %X FF FF
Oops %llX %llX FF000000FF 80497CC00000000
Oops %llu %llu 1095216660735 577753554639388672
Oops %llX %llX FF000000FF 80497CC00000000 if casted to (unsigned int)
Oops %llX %llX FF000000FF 80497CC00000000 if casted to (unsigned long int)
Oops %lX %lX FF 0 if casted to (unsigned long long int)
Good %llX %llX FF FF if casted to (unsigned long long int)

This is not what I expected.

(Please laugh at me if this is a FAQ of type conversion in C.)

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  libc6          2.2.5-11.1     GNU C Library: Shared libraries and Timezone
ii  libc6-dev      2.2.5-11.1     GNU C Library: Development Libraries and Hea
ii  gcc            2.95.4-16      The GNU C compiler.
-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  Osamu Aoki <debian@aokiconsulting.com> @ Cupertino, CA USA         +


---------------------------------------
Received: (at 159804-done) by bugs.debian.org; 3 Nov 2002 20:02:35 +0000
>From nospam@aokiconsulting.com Sun Nov 03 14:02:34 2002
Return-path: <nospam@aokiconsulting.com>
Received: from sccrmhc02.attbi.com [204.127.202.62] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 188Qx8-0007yU-00; Sun, 03 Nov 2002 14:02:34 -0600
Received: from gateway.lan.aokiconsulting.com ([12.234.106.18])
          by sccrmhc02.attbi.com
          (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP
          id <20021103200200.FFIO5946.sccrmhc02.attbi.com@gateway.lan.aokiconsulting.com>
          for <159804-done@bugs.debian.org>; Sun, 3 Nov 2002 20:02:00 +0000
Received: from goofy.lan.aokiconsulting.com ([192.168.1.3])
	by gateway.lan.aokiconsulting.com with esmtp (Exim 3.35 #1 (Debian))
	id 188QwX-0003ky-00
	for <159804-done@bugs.debian.org>; Sun, 03 Nov 2002 12:01:57 -0800
Received: from nospam by goofy.lan.aokiconsulting.com with local (Exim 3.36 #1 (Debian))
	id 188QwV-0006wJ-00
	for <159804-done@bugs.debian.org>; Sun, 03 Nov 2002 12:01:55 -0800
Date: Sun, 3 Nov 2002 12:01:55 -0800
From: Osamu Aoki <debian@aokiconsulting.com>
To: 159804-done@bugs.debian.org
Subject: Re: Bug#159804: Suppliment (printf("%#Xll",x) can be funny)
Message-ID: <20021103200155.GB25520@aokiconsulting.com>
References: <20020906041406.GA29350@aokiconsulting.com> <handler.159804.B.103128568125428.ack@bugs.debian.org> <20020906055753.GA14298@aokiconsulting.com> <874razlo7h.fsf_-_@Astalo.y2000.kon.iki.fi>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <874razlo7h.fsf_-_@Astalo.y2000.kon.iki.fi>
User-Agent: Mutt/1.4i
X-GPG-Fingerprint: 253A 4076 6A3B CCE2 A426  DEF5 E80F C4C1 A806 1F32
Sender: Osamu Aoki <nospam@aokiconsulting.com>
Delivered-To: 159804-done@bugs.debian.org
X-Spam-Status: No, hits=-9.9 required=5.0
	tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_00_01,USER_AGENT,
	      USER_AGENT_MUTT
	version=2.41
X-Spam-Level: 

On Sat, Nov 02, 2002 at 10:18:58PM +0200, Kalle Olavi Niemitalo wrote:
> Osamu Aoki <debian@aokiconsulting.com> writes:
> 
> > If BUG 159804 is stupid question rather than a BUG for the maintainer ,
> > please treat this as wishlist for the missing warning.  (I think it is a
> > bug.)
> 
> gcc -Wall gives plenty of warnings about your program.

Dah, closes this.



Reply to: