4 ms·
"If EINVAL is not a compile-time constant, four of the initializations above are not valid" Wait, why isn't EINVAL a compile-time constant, shouldn't it just b
by Gordonjcp 3y ago
"If EINVAL is not a compile-time constant, four of the initializations above are not valid"
Wait, why isn't EINVAL a compile-time constant, shouldn't it just be an enum?
- londons_explore 3y agoIt has a different constant value on different OS's (Linux, Mac, Windows, etc). Therefore the resulting code, which must run on any OS, cannot treat it as a constant.
- mike_hock 3y agoThus proving that APEs are not viable, the end. The assumption that constants are constants is a sound assumption, and I highly doubt many would be willing to rewrite the world to make some "clever hack" work.
- ahgamut 3y ago> I highly doubt many would be willing to rewrite the world to make some "clever hack" work. I specifically wanted to avoid rewriting the world in order to port established codebases like git/curl to Cosmopolitan Libc. My goal with this gcc patch was to answer the question: "what is the minimum amount of source code I would have to manually change in order to port software to Cosmopolitan Libc?". As we find out, sometimes we don't have to change anything to compile code for an Actually Portable Executable -- just do the usual ./configure && make, and a small `objcopy` command at the end to create the APE.
- Gordonjcp 3y agoAh, right, so while you and I don't care what numerical value in the enum EINVAL has, if I take that numerical value and stuff the binary into another OS then it means something totally different. Right, it's not that it *isn't* a constant, it's that its not the *same* constant everywhere?
- londons_explore 3y agoCorrect.