TeeEmCee wrote: ↑Sep 27, 2023 11:19
I have no idea whether it might actually cause a problem anywhere (due to over-aggressive optimisation, rather than due to a hypothetical non-two's complement machine, of course).
Neither I have; on the other hand, I know one thing: the C emitter is around since several years, by now, and that specific behavior has never caused issues, as far as I know (the issue with Emscripten, in the end, was unrelated with that: previous versions of FreeBasic used the same trick and it caused no issues with Emscripten). So, I would say "If it's not broken, don't fix it"; at the moment it causes no problems anywhere, and since that behavior is now defined, it means more and more compilers will accept it in the future, so the likelihood of related issues is going to decrease even more in the future
caseih wrote: ↑Sep 27, 2023 14:38
The problem with taking advantage of new features in C23 is that most C programs were intended to be portable, and so programmers tend to prefer the lowest common denominator
......
I would prefer that FBC emit code that does not require the behavior.
Well, GCC and clang are the most portable compilers I have ever seen, since they seem to support almost every modern platform, and a lot of old ones.
Personally, the only situation I can imagine where a different, older compiler might be needed would be to emit code for processors older than 80386, but this would not work anyway because of the different memory model