Ha! It's been a long time since GCC was even able to compile older versions of _itself_.
Ha! It's been a long time since GCC was even able to compile older versions of _itself_.
It's just a product of the times.
The behaviour you want isn't "compile this version of Linux even though it has a bug", it's "compile this version of Linux as if you were a compiler at the time which accepted this broken code in this way", which is a very tall order, along the lines of bug-for-bug compatibility while also fixing the bug.
> This is an older release of GCC which we are going to install for the purpose of compiling the Linux kernel in Chapter 8. This version is recommended by the kernel developers when you need absolute stability. Later versions of GCC have not received as much testing for Linux kernel compilation. Using a later version is likely to work, however, we recommend adhering to the kernel developer's advice and using the version here to compile your kernel.
https://www.linuxfromscratch.org/museum/lfs-museum/5.0/LFS-B...
I wish I had a better reference. The bit about "compile this version of Linux as if you were a compiler at the time which accepted this broken code in this way" made me think of that.
A common mistake is expecting code that has undefined behavior to be compiled into something that makes logical sense.
You may disagree with it but that’s how compilers work and how the standard describes they should work.