[Bug c/79022] trunk/gcc/gengtype.h: create_nested_ptr_option: decl & defn don't match ?

2019-03-28 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79022

Eric Gallager  changed:

   What|Removed |Added

   Keywords||diagnostic
 Blocks||89863

--- Comment #6 from Eric Gallager  ---
(In reply to Jonathan Wakely from comment #3)
> Adding a warning about this case seems genuinely useful, i.e. when the names
> match but in a different order.
> 

So, since this is closed, I guess someoneā„¢ should open a separate bug for that
part?

> I'm less convinced that warning about mismatches like void f(int number) and
> void f(int num) is useful, as it would just be noise in many cases.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89863
[Bug 89863] [meta-bug] Issues that cppcheck finds that gcc misses

[Bug c/79022] trunk/gcc/gengtype.h: create_nested_ptr_option: decl & defn don't match ?

2019-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79022

--- Comment #5 from Jonathan Wakely  ---
Author: redi
Date: Thu Mar 28 13:42:48 2019
New Revision: 269990

URL: https://gcc.gnu.org/viewcvs?rev=269990=gcc=rev
Log:
PR c/79022 fix mismatch parameter order in declaratio

The declaration of create_nested_ptr_option in the header has the 'from'
and 'to' parameters in the opposite order from the definition in
gengtype.c:

  /* Return an options structure for a "nested_ptr" option.  */
  options_p
  create_nested_ptr_option (options_p next, type_p t,
const char *to, const char *from)

and the only caller in gengtype-parse.c:

  return create_nested_ptr_option (prev, ty, to, from);

This patch swaps the parameter names in the declaration.

PR c/79022
* gengtype.h (create_nested_ptr_option): Fix parameter names to match
definition.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gengtype.h

[Bug c/79022] trunk/gcc/gengtype.h: create_nested_ptr_option: decl & defn don't match ?

2019-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79022

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |9.0

--- Comment #4 from Jonathan Wakely  ---
Fixed on trunk.

[Bug c/79022] trunk/gcc/gengtype.h: create_nested_ptr_option: decl & defn don't match ?

2019-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79022

--- Comment #3 from Jonathan Wakely  ---
Adding a warning about this case seems genuinely useful, i.e. when the names
match but in a different order.

I'm less convinced that warning about mismatches like void f(int number) and
void f(int num) is useful, as it would just be noise in many cases.

[Bug c/79022] trunk/gcc/gengtype.h: create_nested_ptr_option: decl & defn don't match ?

2019-03-27 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79022

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #2 from Eric Gallager  ---
(In reply to Martin Sebor from comment #1)
> Confirmed.  The parameter names between the function declaration in the
> header and its definition don't match.

Related to this convo on the mailing lists:
https://gcc.gnu.org/ml/gcc/2019-03/msg00058.html

[Bug c/79022] trunk/gcc/gengtype.h: create_nested_ptr_option: decl & defn don't match ?

2017-02-14 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79022

Martin Sebor  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-02-14
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1
   Severity|normal  |minor

--- Comment #1 from Martin Sebor  ---
Confirmed.  The parameter names between the function declaration in the header
and its definition don't match.