9front “The Golden Age of Ballooning” Released
9front.org132 pointsby bitofhope76 comments
if (x < 0)
return 0;
int32_t i = x * 0x1ff / 0xffff;
if (i >= 0 && i < sizeof(tab)) {
(x * 0x1ff / 0xffff) can only be negative if (x < 0), which can be ruled out because the function would have returned already, or if a signed overflow has occurred, which is undefined behavior so anything can happen. The compiler can remove the (i >= 0) check because the only way it's false is if undefined behavior has already been invoked. int i = 2 / x;
if (i != undefined) {
return i;
}
return 0;
Instead, you'll have to do something like: if (x != 0) {
int i = 2 / x;
return i;
}
return 0; #include <stdio.h>
int main(int c,char** v){char*s="#include <stdio.h>%cint main(int c,char** v){char*s=%c%s%c;printf(s,10,34,s,34,10);}%c";printf(s,10,34,s,34,10);}
Surely this should count as a non-cheated quine? Still, parts of the code (namely, the contents of string s) are embedded directly in the binary: % clang -std=c99 -pedantic quine.c -o quine; strings quine | grep include
#include <stdio.h>%cint main(int c,char** v){char*s=%c%s%c;printf(s,10,34,s,34,10);}%c
Even though parts of the original source survive in the binary and are passed as pointers to a print function, the source code itself doesn't get read at compile or runtime (aside from being read once into the compiler). // This function taken from quuxifier (https://example.org/software/quux)
// ⓒ bitofhope 2022, used under the MIT license. See doc/licenses/MIT or
// https://spdx.org/licenses/MIT.html for details.
The same, in my opinion, applies if recognizable (for some definition and threshold of recognizable, which can and does get deep into lawyer territory) portions of that code are emitted by a convolution network. If Copilot can write my function, why can't it write my name and choice of license too? printf "WARNING: %s" "$warn_msg" >&3
But of course, nonstandard.