OiO.lk Blog C++ Old GCC 4.4.7 wasn't initializing randomly
C++

Old GCC 4.4.7 wasn't initializing randomly


I was compiling C legacy projects using:

gcc (GCC) 4.4.7 20120313

On a RedHat6 environment, pretty old.

Now I’m using:

gcc (GCC) 8.5.0 20210514

On a RedHat8 environment, which is better.

Flags were:

-Wl,-s -m32 -o $@ Wuninitialized -Winit-self -Warray-bounds -ftree-vrp

Only diff is I needed to add ""lm", now:

-Wl,-s -m32 -o $@ Wuninitialized -Winit-self -Warray-bounds -ftree-vrp -lm

Executing the same executable and debugging it using -ggdb3 / -O0 shows:

On the RH6 old env / old exe:

On the RH8 old env / old exe:

Causing major issues in lot of part of our legacy applications.
Do you have any ideas of why the behavior has changed ?

New GlibC is:

(GNU libc) 2.28

Old GlibC was:

(GNU libc) 2.12

Thanks !



You need to sign in to view this answers

Exit mobile version