mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/50134 (-Wmissing-prototypes doesn't work for C++)
2012-06-01 Manuel López-Ibáñez <manu@gcc.gnu.org> Jonathan Wakely <jwakely.gcc@gmail.com> PR c++/50134 * doc/invoke.texi (Warning Options): Explain purpose and differences between -Wmissing-prototypes and -Wmissing-declarations. Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com> From-SVN: r188103
This commit is contained in:
parent
d168aaeed9
commit
c3a43311c1
|
@ -1,3 +1,10 @@
|
||||||
|
2012-06-01 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||||
|
Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||||
|
|
||||||
|
PR c++/50134
|
||||||
|
* doc/invoke.texi (Warning Options): Explain purpose and differences
|
||||||
|
between -Wmissing-prototypes and -Wmissing-declarations.
|
||||||
|
|
||||||
2012-06-01 Christian Bruel <christian.bruel@st.com>
|
2012-06-01 Christian Bruel <christian.bruel@st.com>
|
||||||
|
|
||||||
* gcc.c (save_switch): Add user_p parameter.
|
* gcc.c (save_switch): Add user_p parameter.
|
||||||
|
|
|
@ -4416,8 +4416,12 @@ This warning is also enabled by @option{-Wextra}.
|
||||||
@opindex Wno-missing-prototypes
|
@opindex Wno-missing-prototypes
|
||||||
Warn if a global function is defined without a previous prototype
|
Warn if a global function is defined without a previous prototype
|
||||||
declaration. This warning is issued even if the definition itself
|
declaration. This warning is issued even if the definition itself
|
||||||
provides a prototype. The aim is to detect global functions that
|
provides a prototype. Use this option to detect global functions
|
||||||
are not declared in header files.
|
that do not have a matching prototype declaration in a header file.
|
||||||
|
This option is not valid for C++ because all function declarations
|
||||||
|
provide prototypes and a non-matching declaration will declare an
|
||||||
|
overload rather than conflict with an earlier declaration.
|
||||||
|
Use @option{-Wmissing-declarations} to detect missing declarations in C++.
|
||||||
|
|
||||||
@item -Wmissing-declarations
|
@item -Wmissing-declarations
|
||||||
@opindex Wmissing-declarations
|
@opindex Wmissing-declarations
|
||||||
|
@ -4425,7 +4429,9 @@ are not declared in header files.
|
||||||
Warn if a global function is defined without a previous declaration.
|
Warn if a global function is defined without a previous declaration.
|
||||||
Do so even if the definition itself provides a prototype.
|
Do so even if the definition itself provides a prototype.
|
||||||
Use this option to detect global functions that are not declared in
|
Use this option to detect global functions that are not declared in
|
||||||
header files. In C++, no warnings are issued for function templates,
|
header files. In C, no warnings are issued for functions with previous
|
||||||
|
non-prototype declarations; use @option{-Wmissing-prototype} to detect
|
||||||
|
missing prototypes. In C++, no warnings are issued for function templates,
|
||||||
or for inline functions, or for functions in anonymous namespaces.
|
or for inline functions, or for functions in anonymous namespaces.
|
||||||
|
|
||||||
@item -Wmissing-field-initializers
|
@item -Wmissing-field-initializers
|
||||||
|
|
Loading…
Reference in New Issue