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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-09 
09:52:01 UTC ---
(In reply to comment #0)
> When compiling multiple files with inline functions which share the same
> signature and name -O0 produces results inconsistent with -O1, -O2, and -O3
> (which produce the expected result).

As Andreas said, this is an One Definition Rule violation, you need to make the
functions static or put them in an anonymous namespace if you want to have a
different definition in each file.

> gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

This compiler is not supported by the GCC project, the oldest supported release
is 4.3

You should report issues with your compiler to Apple.

Reply via email to