From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10989 invoked by alias); 23 May 2002 00:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10969 invoked by uid 71); 23 May 2002 00:46:01 -0000 Resent-Date: 23 May 2002 00:46:01 -0000 Resent-Message-ID: <20020523004601.10968.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, brian@talusmusic.com Received:(qmail 9837 invoked by uid 61); 23 May 2002 00:41:13 -0000 Message-Id:<20020523004113.9836.qmail@sources.redhat.com> Date: Wed, 22 May 2002 17:46:00 -0000 From: brian@talusmusic.com Reply-To: brian@talusmusic.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/6774: printf("%lld") prints bad values X-SW-Source: 2002-05/txt/msg00695.txt.bz2 List-Id: >Number: 6774 >Category: c++ >Synopsis: printf("%lld") prints bad values >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed May 22 17:46:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Brian Ceccarelli >Release: g++ or g++3 >Organization: >Environment: Red Hat Linux on Intel Mandrake Linux on Intel >Description: # include int main(int c, char *argv[]) { long long i; long long n; for (i=0LL; i<63LL; i++) { n = 1LL << i; printf("1 << %d = %lld\n", i, n); } return 0; } %lld is giving 64 bit results for i < 32 and 0 for i >= 32. >How-To-Repeat: Execute above program. >Fix: None that I can see. Is 64-bit integer formatting supported by g++ compilers? Doesn't seem so. >Release-Note: >Audit-Trail: >Unformatted: