public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Brian Dessent <brian@dessent.net>
To: Kastil <lordgalloth@gmail.com>
Cc: GCC-help <gcc-help@gcc.gnu.org>
Subject: Re: Description warnings
Date: Thu, 31 Jul 2008 17:07:00 -0000	[thread overview]
Message-ID: <4891DB18.AD6D0BA9@dessent.net> (raw)
In-Reply-To: <op.ue5ld50lt61k1h@galloth>

Kastil wrote:

> I was hoping for something which will describe these warnings.

Most diagnostics have a command line switch that can be used to enable
or disable them, and each is documented in the manual:

<http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>

Note that this node only documents generic options, there are also
language-specific options:

<http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html>
<http://gcc.gnu.org/onlinedocs/cpp/Invocation.html>
<http://gcc.gnu.org/onlinedocs/gfortran/Error-and-Warning-Options.html>
<http://gcc.gnu.org/onlinedocs/gcj/Warnings.html>
<http://gcc.gnu.org/onlinedocs/gcc/Objective_002dC-and-Objective_002dC_002b_002b-Dialect-Options.html>

If you're using a recent version of gcc (>= 4.2.x I believe) you can use
-fdiagnostics-show-option to have the compiler tell you the name of the
-Wfoo option corresponding to each diagnostic it prints -- for those
that are controllable by an option.

> Some think
> that will tell me what I have done wrong in my program and why gcc
> produced this warning.

But that is a very different prospect.  It's one thing to document in
general terms the intent behind a given diagnostic, but it's a very
different thing to apply that to a specific instance of a warning in a
specific piece of code.  There is no way that any document is ever going
to be able to tell you with specificity what each message means in the
context of your code.  That requires knowledge of your code, knowledge
of the relevant ISO language standards, and knowledge of the compiler.

> Now when gcc writes me some warning I spend a lot of time trying to figure
> out, what I have done wrong (or what could be done better). I am looking

Try the relevant C and C++ FAQs:

<http://c-faq.com/>
<http://www.parashift.com/c++-faq-lite/>

Brian

  reply	other threads:[~2008-07-31 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 11:12 Kastil
2008-07-31 11:31 ` Eljay Love-Jensen
2008-07-31 15:33   ` Kastil
2008-07-31 17:07     ` Brian Dessent [this message]
2008-08-02 13:52 Eus

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=4891DB18.AD6D0BA9@dessent.net \
    --to=brian@dessent.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=lordgalloth@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).