Compiling with Be.h impossible (broken header)

I see no working bug-tracker so maybe somebody can help me with this problem. Compiling works as long as there is no Be.h included. As soon as Be.h is included compilation totally fails:

This happens with both gcc 4 and gcc 2. I’ve got the nightly build from like a couple of days ago. Even in a nightly build an important header like this one should not be that broken. Anybody else has seen this?

EDIT: This is a vital problem since I always compile -Wall -Werror … and even if not… system headers should not contain this kind of problem.

The bugtracker is at http://dev.haiku-os.org

You will need -Wno-multichar to remove this warning. Multi-character constants are widely used in Haiku and are actually standard C and C++, so the warning is from the compiler trying to be too strict.

This is not really correct. Multi-character constants are “implementation defined”. The behavior is undefined and each compiler can do it whatever way it seems fit. GCC states how it does implement this undefined behavior (11.1 Implementation-defined behavior). This especially means that headers using such constants would be neither ABI nor API compatible across different compilers since each can compile the header constants differently as it likes. That’s not what system constants are supposed to do.

I wanted to fix the headers to use correct and well-defined behavior (aligned with GCC implementation-defined behavior to be API/ABI compatible) but I can not alter the files under /boot/system, neither change their permission to root-writable. It claims the file system is read-only. How can I make /boot/system read-write so I can apply the fixes?

The behavior is defined by the implementation (as is the mangling of symbols for the C++ ABI, for example). We don’t expect different compilers to be compatible and this is why we provide multiple sets of libraries (at the moment, one for gcc 2.95.3, and the other for gcc 5.4) for backward compatibility.
you can’t write to /boot/system because it is a virtual folder made by mounting the content of packages (from /system/packages) directly (they are not extracted to disk). So, if you really want to change system includes this way, there are two solutions:

  1. Extract the files from the haiku_devel package (using the “package” tool), make your changes, and rebuild the package (again using the “package” tool). Install your modified package into /system/packages, replacing the previous version.
  2. Override the headers by putting replacements in a writable path. /boot/system/non-packaged/develop/headers/ should be in the default include path, and writable, so it is a good place to do this.

Nope, this doesn’t work. I put the modified version into /boot/system/non-packaged/develop/headers/os/… but they are not picked up. It still takes the packaged headers failing to compile. Any other solution without modifying the packages?