From: Russ Allbery <rra@stanford.edu>
To: gdb-patches@sources.redhat.com
Subject: Re: GDB CVS won't build on OSF4.0's cc
Date: Mon, 11 Jun 2001 01:33:00 -0000 [thread overview]
Message-ID: <ylvgm3tnz8.fsf@windlord.stanford.edu> (raw)
In-Reply-To: <200106110808.LAA17400@is.elta.co.il>
Eli Zaretskii <eliz@is.elta.co.il> writes:
>> From: Alexandre Oliva <aoliva@redhat.com>
>> On Jun 10, 2001, Eli Zaretskii <eliz@is.elta.co.il> wrote:
>> >> - memset ((PTR) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info));
>> >> + memset ((void *) objfile->sym_stab_info, 0,
>> >> + sizeof (struct dbx_symfile_info));
>>> Do we _really_ have compilers which require to cast the first argument of
>>> memset to (void *)?
>> Dunno. I was just dumbly replacing PTR with void*, as requested.
> Does anyone know?
> IMHO, excess casting is evil, as it can mask programmatic errors.
> However, if GDB standards don't frown on this, it's fine by me.
If memset is prototyped as taking a void *, this cast is unnecessary; the
C standard requires that the argument be converted appropriately due to
the prototype. If memset is prototyped as taking a char *, this cast
neither hurts nor helps; the pointer has to be converted into a char *
anyway and that would be done by the prototype.
If memset isn't prototyped or has a K&R-style prototype without argument
types, then this could arguably help if pointers to different types of
objects were represented differently internally. I'm a little skeptical
whether gdb supports such systems without proper function prototypes, and
I'd argue that this case is so insanely rare as to not bother worrying
about, particularly since gdb is now requiring ANSI C.
I've been systematically ripping those sorts of casts out of INN for a
while now.
--
Russ Allbery (rra@stanford.edu) < http://www.eyrie.org/~eagle/ >
next prev parent reply other threads:[~2001-06-11 1:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-29 3:20 Alexandre Oliva
2001-05-29 3:42 ` Alexandre Oliva
2001-05-29 4:12 ` Alexandre Oliva
2002-03-06 16:12 ` Alexandre Oliva
2002-03-06 17:58 ` Andrew Cagney
2002-03-06 18:52 ` Alexandre Oliva
2002-03-13 11:19 ` Alexandre Oliva
2002-03-25 8:43 ` Alexandre Oliva
2001-06-06 13:20 ` Elena Zannoni
2001-06-09 16:14 ` Alexandre Oliva
[not found] ` <Pine.SUN.3.91.1010610111224.5638I-100000@is>
2001-06-10 14:25 ` Alexandre Oliva
2001-06-11 1:06 ` Eli Zaretskii
2001-06-11 1:33 ` Russ Allbery [this message]
2001-06-11 7:04 ` Andrew Cagney
2001-06-11 6:32 ` Elena Zannoni
2001-06-11 6:34 ` Elena Zannoni
2002-03-06 16:36 ` Alexandre Oliva
2002-03-13 11:19 ` Alexandre Oliva
2002-03-19 9:41 ` Elena Zannoni
2002-03-19 10:31 ` Alexandre Oliva
2002-03-19 10:48 ` Elena Zannoni
2002-03-19 18:23 ` Alexandre Oliva
2002-03-19 18:39 ` Andrew Cagney
2002-03-19 20:40 ` Elena Zannoni
2002-03-20 0:00 ` Alexandre Oliva
2002-03-20 7:08 ` Elena Zannoni
2002-03-19 23:43 ` Alexandre Oliva
2002-03-20 7:10 ` Elena Zannoni
2002-03-20 14:27 ` Alexandre Oliva
2002-03-25 8:49 ` Alexandre Oliva
2001-05-29 9:30 ` Kevin Buettner
2001-05-30 19:54 ` Alexandre Oliva
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=ylvgm3tnz8.fsf@windlord.stanford.edu \
--to=rra@stanford.edu \
--cc=gdb-patches@sources.redhat.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