This is the mail archive of the gcc-bugs@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]

[Bug c++/43272] -Wmissing-prototypes doesn't work in C++ mode



------- Comment #14 from redi at gcc dot gnu dot org  2010-03-15 18:39 -------
(In reply to comment #10)
> The case that I keep running into all the time is that I convert a bunch of
> code from "char *" from "const char*", then go update the header to match up
> with the code, but happen to miss one (or more) prototypes that needed to be
> changed.  The code compiles, 
> Then sometime later, I (or another developer) build some code that uses the
> library, a link error occurs, and we're sitting there scratching our heads
> wondering why it's complaining about a function that, at first glance, appears
> to exist.

When you change a function in the library, write a trivial test to verify that
you can link to the expected functions.  You don't have to test the
functionality, just check that you can include the header, call the functions
it declares, and link to definitions of those functions.

If you're refactoring libraries and not writing tests to ensure you can still
link then lack of a compiler warning isn't the problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43272


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