public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Keith Seitz <keiths@cygnus.com>
Cc: Willem Hajenius <willem.hajenius@ping.be>,
	<insight@sourceware.cygnus.com>
Subject: Re: Bugs/Features
Date: Thu, 13 Sep 2001 16:53:00 -0000	[thread overview]
Message-ID: <87y9ni7hz2.fsf@creche.redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.33.0109131237200.9617-100000@makita.cygnus.com>

Keith> Unfortunately, as you've discovered, the "dismissable" warnings
Keith> are renewed every time Insight is run.

I think there's a PR for this.

>> struct rec
>> {
>> char c[5];
>> };
>> 
>> f = (foo*) malloc (10);

Keith> (I must say -- this is an evil coding practice! Why hide the
Keith> true type of the variable? If you want to make it opaque, just
Keith> make it opaque and cast it when needed. Maybe this is just a
Keith> bad example??)

Actually this is the old C `struct hack' idiom.  In traditional C you
were allowed to declare the last field in a struct as an array; then
you could allocate additional space and it would act like a
variable-sized array, without the overhead of an additional pointer in
the struct.

It isn't very common, but it isn't uncommon either.

Tom

      reply	other threads:[~2001-09-13 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-13 12:27 Bugs/Features Willem Hajenius
2001-09-13 13:08 ` Bugs/Features Keith Seitz
2001-09-13 16:53   ` Tom Tromey [this message]

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=87y9ni7hz2.fsf@creche.redhat.com \
    --to=tromey@redhat.com \
    --cc=insight@sourceware.cygnus.com \
    --cc=keiths@cygnus.com \
    --cc=willem.hajenius@ping.be \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).