My latest patch for Terminal has failed to build on x86_gcc2, I believe because of my use of an array initializer in a constructor that was introduced in (I think) C++11. I’m happy to fix this of course (and will be adding x86_gcc2 to my testing workflow). I don’t think there is a compatible initializer syntax for both C++ standards (?) so expect I should just initialize in the body of the constructor unless review has a better suggestion.
But I noticed that the Haiku Coding Guidelines doesn’t mention the case where an outright conflicting syntax might exist for the compiler versions, and the preferred resolution for that. So I figured I’d bring the question here. Is there a generally applicable approach that is preferred? For example: “Always use syntax that is compatible with C++98”, or maybe instead “Sometimes it is required to use obsolete syntax for x86_gcc2, handle this on a case-by-case basis”? Does this occur enough for a statement/example to be worth adding to the guidelines?
If the code needs to be buildable for gcc2 then only use compatible syntax. This is normally only the case for Kernel code and userspace libraries. I’m not sure why Terminal would be build on the gcc2 arch… maybe it can be removed to only build on modern gcc
Which lead to next question: how to make all jam targets builds with latest GCC except for explicit targets requiring to be ABI compatible when building Haiku for gcc2h ?