This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30583] [ODR] Non-static inline functions cause bugs when defined more than once in different files
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Feb 2007 10:49:04 -0000
- Subject: [Bug c++/30583] [ODR] Non-static inline functions cause bugs when defined more than once in different files
- References: <bug-30583-13987@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2007-02-12 10:49 -------
To dect an ODR violation in this case, means a couple of things. First you
cannot compare byte for byte the function as one might be compiled with
optimizations and the other was compiled without. And then if you just compare
the size you run into the same problem because the funcitons might be optimized
differently.
Binutils at one tried adding that and guess what, it was warning all the time
on libstdc++ because optimization differences. It was only doing guesses based
on the size and not even based on byte for byte comparision.
This is a hard problem to solve really which is why the standard mentions that
this invalid does not have to be errored about.
Also it is really hard to do in the compiler when we don't do any link time
optimization at this point anyways.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30583