tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

building with C89 host compiler



On Fri, 02 Jan 2015, Antoine LECA wrote:
On 2014-12-31 00:52Z, Kamil Rytarowski wrote:
We expect a C99 userland for bootstrapping, don't we?

src/tools/README rev. 1.3 says about obligatory c89 compatibility

Then that README is just obsolete.

... or there are bugs in some tools, or there are missing compatibility interfaces in tools/compat.

At the time that I wrote that part of src/tools/README, I was under the impression that I was documenting the existing practice of adding C99 library features to tools/compat as and when the need for them was noticed, and avoiding C99 language features such as open arrays in structures (with "[]" instead of an actual array size), designated initializers, or declaring variables inside the body of a for loop.

I still think that being able to build tools with a C89 compiler is
a worthwhile goal.  However, both clang and gcc >= 4.8 need C++98,
so we'd have to exempt the compilers themselves from the "stick to
C89" guideline, if we keep the guideline at all.  There are still some
NetBSD ports that use gcc-4.5 as the compiler, and those should still be
capable of being bootstrapped on a host with a C89 compiler.

I had a hard time trying to cross-compile NetBSD from Interix (which features the Microsft libc, C89 conforming but definitively lacking a number of C99 library features) and it was all pain.

Did you report the problems?

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index