Conversation
>On success, these functions return the file descriptor of the temporary file. On error, -1 is returned, and errno is set to indicate the error.

man FUCK LINUX what fucking nigger came up with this? we've got 2,147,483,646 values to send errors in, what will we use? oh the global variable will be a good place!
5
0
1
@protos Are you certain the return code is a 32-bit integer?
2
0
1
@HatkeshiatorTND trying to figure out why this is going wrong, and this is obscuring using gdb
1
0
1
@Zergling_man even if it is a 16 bit integer in 1990, that is still plenty
0
0
2
@protos please understand, bell labs was a small billion dollar indie company and could never have known their silly design mistakes when unix still ran on a single core would lead to such hassle 50 years later
0
0
1
@protos fun fact, the c abi of most(all?) plattforms supports multiple return values
0
0
2
@protos this is why the C programming language should be boycotted
1
0
0
@meeper C, the good parts (no errno and no null terminated strings)
4
1
2
@protos or most of the standard library imo,

idk it just feels very wrong and messy.

Also namespaces are a good thing and ENOWENCHES et al as convention is plain bad
2
1
3
@david @HatkeshiatorTND oh no it's vibe coded, time to switch to templeos
1
0
2
@meeper C has namespaces if the guy making the library was smart enough to use a define prefix
0
0
3
@protos @david the claude button just points to man.9front.org/1/fortune (which is strictly superior to claude)
1
0
1
@protos @meeper What's wrong with null-terminated strings?
2
0
0
@protos @david IT NO LONGER DOES THIS
WHAT THE HELL
NOW IT POINTS TO SOME STUPID LEGAL THING
2
0
1
@david @protos >submitted code is not computer generated
YOU WANT ME TO SUBMIT HANDWRITTEN CODE, YOU FUCKS? WHERE'S YOUR PO BOX?
OR IS IS TYPING RANDOM BUTTONS THAT THE COMPUTER CONVERTS INTO A STREAM OF COMPUTER-READABLE BYTES NOT "COMPUTER GENERATION" TO YOU?
0
0
1
@Zergling_man @protos A lot of things - for one it's a poor convention and break strings being a list of bytes.

Also breaks the C convetion of length parameter, which is god.

Getting a string length also becomes O(n) instead of O(1), and makes a lot of operations stupidly more complicated for no benefit aside from slightly more memory in ancient PCs (we waste exponential orders of magnitude more ram on shitty code)
0
0
3
@Zergling_man @meeper compute inefficient to get the length which is required for memcpy, means substrings are not strings for APIs, doesn't even save space when compared to length-prefixed strings ([-1] being 0-127 length, [-2] being 128-16383 is practically identical), and these make an API that depends on them like string.h retarded
0
1
3
@tobias @meeper garbage collection chino_dead1
rust is better
1
0
1
@HatkeshiatorTND @meeper yes, if C had type introspection printf would be good
1
0
1
@protos @meeper if c didn't have types, you could xtostr(variable) (for various x, with whatever transformations you want in each case) and you could just strcat them together. build your string bit by bit, no gay format specifiers unless you write your own macro layer that used them.
1
0
0
@HatkeshiatorTND @meeper no format specifier at all, just printf("{}: {}.{}", 0, 'c', "R"};
1
1
1
@protos @meeper i prefer something like `(for ((= i 0) (< i (len slurs)) (++ i)) (block (= slur (atindex i slurs)) (= sentence (strcat (decimaltostr i) ".\tfucking " slur ", i hate em. total " slur " death.\n")) (write sentence stdout))`
1
0
0
@protos @meeper "s-expressions?" yes, emitting an ast is the programmer's job, not the compiler's.
0
0
0