public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: duane@franklin.com
Cc: insight@sourceware.cygnus.com
Subject: Re: Warnings
Date: Thu, 18 Nov 1999 23:45:00 -0000	[thread overview]
Message-ID: <3834FFDB.70966E75@cygnus.com> (raw)
In-Reply-To: <199911181535.KAA02806@mars.franklin.com>

Duane Ellis wrote:
> 
> Here at Franklin, we have an internal requirement that *ALL* code we write
> is compiles with no warnings or errors and with these options:
> 
>      -Wall -Wmissing-prototypes -Wstrict-prototypes
> 
> and in most cases, -Werror also.

For GDB, compiling with most warning flags enabled is a long term goal. 
Right now configuring/building using:

--enable-build-warnings="-Werror\
,$Wimplicit\
,-Wreturn-type\
,-Wcomment\
,-Wtrigraphs\
,-Wformat\
,-Wparentheses\
,-Wpointer-arith\
,-Woverloaded-virtual\
"

is known to build on a number of platforms. I believe people are
currently (slowly) chipping away at more of the unitialized and
prototype warnings.  If you've got patches (and an assgnment) then
patches are welcome.

BTW, the warning options enabled by -Wall were chosen according to a
somewhat arbitrary selection criteria.

[...]
> We have a standard way of getting rid of this here.
> 
> Add the following to "defs.h"
> 
> #define GDB_UNUSED_PARM( NAME )         (void)(NAME)
> 
> Then, in function in this example in utils.c" would look like this:
> 
> static void
> pagination_off_command (arg, from_tty)
>      char *arg;
>      int from_tty;
> {
>   GDB_UNUSED_PARAM( arg );
>   GDB_UNUSED_PARAM( from_tty );
>   pagination_enabled = 0;
> }
> ------------------------------------------------------------
> 
> Have you guys thought of adding these changes to Insight?

Not so far.  GDB's code is riddled with #ifdefs that make it difficult,
in general, to eliminate unused variable warnings (parameters or
locals).  What is used on one host/target is not on a second :-(.

As a personal opinion, I think a better way of getting rid of this
particular warning would be to modify GCC so that it differentiated
between local and parameter variables :-)

	enjoy,
		Andrew

      reply	other threads:[~1999-11-18 23:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-18  7:45 Warnings Duane Ellis
1999-11-18 23:45 ` Andrew Cagney [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=3834FFDB.70966E75@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=duane@franklin.com \
    --cc=insight@sourceware.cygnus.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).