[Bug c/54113] -Wmissing-prototypes produces false alarms for C99 inline functions

2017-09-06 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #5 from Eric Gallager  ---
(In reply to Paul Eggert from comment #0)
> 
> The simplest way to work around the problem is to avoid
> the use of -Wmissing-prototypes, but that disables the
> diagnostic for non-inline functions, where it's useful.
> 

Note that this only works for plain C; using diagnostic pragmas (like those
expanded from gnulib's _GL_INLINE_HEADER_BEGIN) to suppress
-Wmissing-prototypes leads to the following warning in C++:

build-gnulib/../config.h:2101:5: warning: option ‘-Wmissing-prototypes’ is
valid for C/ObjC but not for C++ [-Wpragmas]
 _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
 ^~~

[Bug c/54113] -Wmissing-prototypes produces false alarms for C99 inline functions

2013-12-04 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2013-12-04
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Marek Polacek mpolacek at gcc dot gnu.org ---
I have a patch for disabling the diagnostic  for inline functions in C99 mode.


[Bug c/54113] -Wmissing-prototypes produces false alarms for C99 inline functions

2013-12-04 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113

--- Comment #3 from Marek Polacek mpolacek at gcc dot gnu.org ---
Author: mpolacek
Date: Wed Dec  4 21:15:31 2013
New Revision: 205680

URL: http://gcc.gnu.org/viewcvs?rev=205680root=gccview=rev
Log:
PR c/54113
c/
* c-decl.c (start_function): Don't warn for missing prototype for
inline functions.
testsuite/
* gcc.dg/pr54113.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr54113.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-decl.c
trunk/gcc/testsuite/ChangeLog


[Bug c/54113] -Wmissing-prototypes produces false alarms for C99 inline functions

2013-12-04 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Marek Polacek mpolacek at gcc dot gnu.org ---
Fixed on trunk.