public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joern Rennecke <amylaar@cygnus.co.uk>
To: haible@ilog.fr (Bruno Haible)
Cc: egcs@cygnus.com
Subject: Re: [patch] struct member warning
Date: Mon, 02 Mar 1998 20:02:00 -0000	[thread overview]
Message-ID: <199803030030.AAA30746@phal.cygnus.co.uk> (raw)
In-Reply-To: <199803021445.PAA03117@halles.ilog.fr>

> It is a pitfall in C and C++ that a structure can have a static initializer
> which lists less elements that the structure has. The remaining elements
> are silently initialized with 0. This may or may not be what the programmer
> intended. If the programmer intends this, she can easily write the 0es
> explicitly. Here is a patch which adds a warning (triggered by
> "-Wuninitialized").

I think that is the wrong switch.  Initialized to zero is considerably
different from uninitialized.  If you must have a warning for this
construct (which is sometimes essential for portable code, i.e. to
initialize structs with union members), then IMO it should have a
more fitting name, like -Wimplicit-initialization.

  reply	other threads:[~1998-03-02 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-02  6:46 Bruno Haible
1998-03-02 20:02 ` Joern Rennecke [this message]
1998-03-31  0:46 Bruno Haible

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=199803030030.AAA30746@phal.cygnus.co.uk \
    --to=amylaar@cygnus.co.uk \
    --cc=egcs@cygnus.com \
    --cc=haible@ilog.fr \
    /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).