public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: ydi@eecs.uic.edu To: gcc-gnats@gcc.gnu.org Cc: zwei@eecs.uic.edu Subject: c/3112: printf error for structs with "long long" members Date: Sun, 10 Jun 2001 17:26:00 -0000 [thread overview] Message-ID: <20010611001822.14469.qmail@sourceware.cygnus.com> (raw) >Number: 3112 >Category: c >Synopsis: printf error for structs with "long long" members >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sun Jun 10 17:26:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Yu Di >Release: gcc version 2.95.2 19991024 (release) >Organization: >Environment: Solaris 2.7, Generic_106541-12 sun4u sparc SUNW,Ultra-60 >Description: If we try to print several member variables in a struct, with one of them being "long long" type, the other member variable displays will be also wrong. If the following program is compiled and executed, it outputs "0,20" instead of "20,10" #include <stdio.h> main() { struct aaa { unsigned long long x; unsigned short y; } a; a.x = 20; a.y = 10; printf("%lu, %d\n", a.x, a.y); /*We know that %lu can't work for a.x, but it shouldn't affect a.y. If we change the sentence to printf("%lf, ...), it will work correctly for both values */ } >How-To-Repeat: See our program in the description >Fix: N/A >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-06-10 17:26 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-06-10 17:26 ydi [this message] 2001-06-11 4:11 jsm28 2001-06-15 2:36 Joseph S. Myers
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20010611001822.14469.qmail@sourceware.cygnus.com \ --to=ydi@eecs.uic.edu \ --cc=gcc-gnats@gcc.gnu.org \ --cc=zwei@eecs.uic.edu \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).