gcc 4.7 changes binary behaviors ?

Jakub Jelinek jakub at redhat.com
Fri Jan 27 07:48:19 UTC 2012


On Fri, Jan 27, 2012 at 05:22:20AM +0000, Sérgio Basto wrote:
> > As an illustration gcore also broke with gcc-4.7 but it was a bug of gcore:
> > 	http://sourceware.org/ml/binutils/2011-12/msg00298.html
> 
> "as the code violates ISO C99 6.2.4 item 5 by using local variable
> outside of 
> its block, GCC optimizes out the second memcpy, keeping there only that
> memset."
> 
> well kmk_sed code not have necessary to be ISO C99, which could be a tip
> try compile kbuild without change behavior of gcc < 4.7 

My complain about bundling of libraries etc. was just a generic one, if
for some particular reasons you can't stop doing that, you need to apply the
patch I've referenced in my earlier mail to kBuild sources as well.
It is triggering undefined behavior too, by lying to the compiler
that a function is pure (a function that only uses its arguments and can
read memory in order to return result, but can't modify global state)
when it modifies memory.

	Jakub


More information about the devel mailing list