public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joel Sherrill <joel@rtems.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Jonathan Wakely <jwakely.gcc@gmail.com>,
	Eric Gallager <egall@gwmail.gwu.edu>,
		David Brown <david.brown@hesbynett.no>,
	"Joseph S. Myers" <joseph@codesourcery.com>,
		GCC <gcc@gcc.gnu.org>
Subject: Re: Warning for C Parameter Name Mismatch
Date: Sat, 09 Mar 2019 17:51:00 -0000	[thread overview]
Message-ID: <CAF9ehCU8mMBW4nBy8pTMdb7Y8sLEErf1+_W97EmKJC13V93ydA@mail.gmail.com> (raw)
In-Reply-To: <20190309172652.GE3969@gate.crashing.org>

On Sat, Mar 9, 2019, 11:27 AM Segher Boessenkool <segher@kernel.crashing.org>
wrote:

> On Sat, Mar 09, 2019 at 08:30:19AM +0000, Jonathan Wakely wrote:
> > On Sat, 9 Mar 2019, 02:23 Eric Gallager, <egall@gwmail.gwu.edu> wrote:
> > > How would it handle the case where the parameter name is missing
> > > entirely from the prototype? I see a lot of header files with their
> > > prototypes written like that.
> > >
> > > e.g.
> > >
> > > int f(int);
> > >
> > > int f(int y) {...}
> >
> > I don't think that's valid in C, only C++, and I would expect no warning
> > for such cases. But I don't see much value in the suggested warning at
> all.
>
> This is perfectly fine C.  Parameter names are optional in prototypes.
> It's different if it is the function definition, I think that is what
> you mean?
>

That's how I read it and that would not be a warning IMO.

Back to a point in my original email that seems to have been missed.
Doxygen reports this as a warning. I would just like the option to find it
with gcc as well.

And not checking system headers is reasonable in general. For RTEMS though,
we are implementing those system headers and do follow the names in the
standards for parameter names in the implementation.

--joel

>
>
> Segher
>

  reply	other threads:[~2019-03-09 17:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 22:25 Joel Sherrill
2019-03-08 23:06 ` Joseph Myers
2019-03-08 23:36   ` David Brown
2019-03-09  2:23     ` Eric Gallager
2019-03-09  8:30       ` Jonathan Wakely
2019-03-09 17:27         ` Segher Boessenkool
2019-03-09 17:51           ` Joel Sherrill [this message]
2019-03-11 11:35             ` Jonathan Wakely
2019-03-11 11:26           ` Jonathan Wakely
2019-03-09 12:22       ` David Brown
2019-03-28  6:07 ` Eric Gallager
     [not found] <1552168709.15796.ezmlm@gcc.gnu.org>
2019-03-10  6:11 ` Basile Starynkevitch
2019-03-10 11:54   ` David Brown
2019-03-10 12:05     ` Basile Starynkevitch

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=CAF9ehCU8mMBW4nBy8pTMdb7Y8sLEErf1+_W97EmKJC13V93ydA@mail.gmail.com \
    --to=joel@rtems.org \
    --cc=david.brown@hesbynett.no \
    --cc=egall@gwmail.gwu.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=jwakely.gcc@gmail.com \
    --cc=segher@kernel.crashing.org \
    /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).