This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning for C Parameter Name Mismatch


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?


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]