This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/3112: printf error for structs with "long long" members
- To: nobody at gcc dot gnu dot org
- Subject: Re: c/3112: printf error for structs with "long long" members
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: 15 Jun 2001 09:36:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
The following reply was made to PR c/3112; it has been noted by GNATS.
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Yu Di <ydi@eecs.uic.edu>
Cc: <gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>, <zwei@eecs.uic.edu>
Subject: Re: c/3112: printf error for structs with "long long" members
Date: Fri, 15 Jun 2001 10:31:23 +0100 (BST)
On Thu, 14 Jun 2001, Yu Di wrote:
> Hi, thanks for the reply, but I still have a question. I know "%lu" is not
> the correct format for "long long" variables, and that member will not get
> displayed correctly. But the question is: why the second struct member is
> also not displayed correctly?
As I said, read the Application Binary Interface (ABI) specification for
your system. You may find that longs take up four bytes of stack space
and long longs eight bytes, so if printf takes a long where you put a long
long, it will locate subsequent arguments incorrectly as well. Or there
may be some other calling convention with a similar effect.
--
Joseph S. Myers
jsm28@cam.ac.uk