From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: schwab@suse.de
Cc: msnyder@vmware.com, gdb-patches@sourceware.org, teawater@gmail.com
Subject: Re: [RFA record/replay] cast to avoid compiler warning
Date: Sun, 05 Oct 2008 09:54:00 -0000 [thread overview]
Message-ID: <200810050954.m959s7GA011717@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <jetzbrqzxc.fsf@sykes.suse.de> (message from Andreas Schwab on Sun, 05 Oct 2008 09:11:27 +0200)
> From: Andreas Schwab <schwab@suse.de>
> Date: Sun, 05 Oct 2008 09:11:27 +0200
>
> Mark Kettenis <mark.kettenis@xs4all.nl> writes:
>
> >> Date: Sat, 04 Oct 2008 11:42:47 -0700
> >> From: Michael Snyder <msnyder@vmware.com>
> >>
> >> Sizeof returns size_t, which is not always the same as int.
> >> This cast will prevent compiler warnings on some architectures
> >> (eg. x86_64)
> >
> > This is wrong! Better cast to unsigned long and print as %lu.
>
> The value will always be a small number.
It is still a bad example. People may copy the idiom and uses it on
cases where the value is not a small number. Why rely on the fact
that it always will be a small number if you can fix it properly?
next prev parent reply other threads:[~2008-10-05 9:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-04 18:45 Michael Snyder
2008-10-04 21:53 ` Mark Kettenis
2008-10-05 7:12 ` Andreas Schwab
2008-10-05 9:54 ` Mark Kettenis [this message]
2008-10-05 11:02 ` Andreas Schwab
2008-10-05 12:17 ` Mark Wielaard
2008-10-05 15:47 ` Michael Snyder
2008-10-05 16:05 ` Daniel Jacobowitz
2008-10-05 18:28 ` Michael Snyder
2008-10-05 18:40 ` Mark Kettenis
2008-10-05 19:41 ` Eli Zaretskii
2008-10-05 20:35 ` Michael Snyder
2008-10-05 21:03 ` Mark Kettenis
2008-10-06 7:29 ` teawater
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=200810050954.m959s7GA011717@brahms.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=schwab@suse.de \
--cc=teawater@gmail.com \
/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: link
Be 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