[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: Chud.png (286 KB, 1059x929)
286 KB
286 KB PNG
#include <stdlib.h>
>rust and LGBT community starts shaking and staring at you
void main() {
>you hear screams, people in panic begging for you to stop, some using their striped socks to cover their eyes
void *p = malloc(sizeof(int));
>many die of heart attacks, many jump off the window, some overdose in HRT pills
>>
>>107977754
>coding in the big 26
ngmi luddite, learn to use ai
>>
>>107977785
AI is for jeetscript
You are a Jeet
I don't like Jeets
>>
>>107977754
#include <lgbt.h>

int
rainbow(int hormones, char* transition[])
{
int mtf;

for (mtf = 0; mtf < hormones; mtf++) {
traniffy(transition[mtf]);
}
return 0;
}
>>
>>107977804
/usr/bin/ld: /tmp/ccxZ1a2b.o: in function `rainbow':
lgbt.c:(.text+0x15): undefined reference to `trannify'
collect2: error: ld returned 42% suicide status
>>
>>107977799
>ai is for jeetscript
>actually, ai is used to create a browser from scratch.
https://cursor.com/blog/scaling-agents
lmao, codefag cope
>>
I'm sticking to C unironically
>>
>>107977822
just link against the rust std
>>
>>107977846
Yet not even the AI shills are actually using the browser...
>>
File: NU METAL.png (1.22 MB, 1080x1744)
1.22 MB
1.22 MB PNG
>>107977804
>>107977822
brutal
>>
>>107977822
>>107977872
Kek
>>
>>107977886
>actually, the browser is not THAT good, therefore ai is useless
cope more
>>
>>107977900
@grok put this jeet in a bikini
>>
File: laputan.png (226 KB, 1520x938)
226 KB
226 KB PNG
not sure if such mentality should hold to

- glasses (good vision is superior to bad vision)
- pinguins (too specific and polluted)
- malloc (antique, non superior)

not sure about <stdlib.h> either

so

- no glasses
- preferably bold
- duck not penguin
- <stdint.h>
>>
>>107977984
>>
>>107977754
>void *p = malloc(sizeof(int));
you just know a /g/eet waking up will deliver on tard maxxing.
but anyway. to stoop to the average /g/eet level of intelligence. let me point out that c exists in rust, but rust doesn't exist in c ;);)

#![no_main]

use std::ffi::{c_int, c_void};
use std::mem::size_of;

unsafe extern "C" {
fn malloc(size: usize) -> *mut c_void;
}

#[unsafe(no_mangle)]
pub extern "C" fn main() -> c_int {
unsafe {
let p = malloc(size_of::<c_int>()) as *mut c_int;
*p = 42;
*p
}
}
>>
File: c_for_baby.png (70 KB, 724x464)
70 KB
70 KB PNG
>>107977754
i am transgender and use C almost exclusively
i'm not even kidding, either
>>
What are chances this is a biological female?
https://nora.codes/
>>
>>107978143
Every day I see something that makes me welcome merciful death just a little bit more
>>
>>107977754
>use Go
>Ctards coping with segfaults
>Pytards coping with being dumbasses
>Rustards coping with being troons
Go is the only correct language
>>
>>107978205
I've never tried Go. It's not a C replacement so I never bothered.
From what very little I've seen, it kind of makes me think of C# but for Unix. And I don't hate C#, it just has that "he's a more productive way of doing things that still has that spirit of the old way a little bit" kind of feeling similar to C#.
>>
>>107978205
go is for retards, slapped with telemetry. stdlib is shoveled down the throat and obligatory. used to make a container, a cope cage. sorry bro.
>>
File: zzz.png (33 KB, 612x741)
33 KB
33 KB PNG
CMake
>The rustroon ACK'd
GPLv2 license on top of all .cpp and .h files
>MIT and BSD shills in shambles
#include <complex>
>mathlets and soiware "engineers" ACK'd
#include <opus/opus.h>
>this kills the Fraunhofer proprietroons
>>
>>107978306
>"slapped with telemetry"
You don't know shit about code langs, begone
>>
>>107977754
your program is of course a valid C++ program
the C/C++ brotherly war is pretty silly
>>
>>107977754
>void main
not c.
>>
>>107978711
some jeets still learn with wintard IDEs from decades ago (where void main() does exist). they don't know anything about language standards, or acquire any relevant knowledge beyond the very narrow monkey training they get.
>>
>>107978143
Bussy or it didn't happen.
>>
>>107977754
C installs a backdoor and mind virus in people who use it. Trannies are a side effect of using C.
>>
File: 84541 - SoyBooru.png (104 KB, 799x799)
104 KB
104 KB PNG
>>107977785
Not everyone's a wagie. I C because it's the best for my hobbyist programming.
>>
>>107978953
sorry i am not a slut (but i am cute and really fucking good at programming)
>>
>>107977799
To the contrary anon, I am a jeet and I hate AI and like C. You actually hate C programmers.
>>
We've got troons and jeets on board already. What's missing?
>>
>>107977754
Based. But honestly D solves all the gaps of C. No more guaranteed ability to segfault on printfs, while still being ABI compatible with C and able to compile and link with it natively.
>>
>>107980119
D solves a lot of things, but that's more of C++ replacement. C still has an edge when it's reckless power is exercised cautiously.
>>
>>107977754
>>rust and LGBT community
same thing
>>
>>107980147
You can do all of that in D, you can avoid the D runtime and do all the C things at the exact same C level of power and baremetal programming and optimizations and inline assembly, with all the added D sweetness on top of the world's best metaprogramming and reflection and templating and compile time memory safety without losing a thing. You don't have to do any of the C++-replacement stuff.
>>
>>107980167
Any safety measures will innevitably result in inferior performance. If you think " No more guaranteed ability to segfault on printfs" comes for free, think again.
>>
>>107978139
That is grotesque
>>
>>107977754
What's it like constantly thinking about LGBT nonsense? I mean, I dislike that whole group as much as anyone, but I don't spend my time constantly thinking about it.
>>
>>107978966
the first word in C definition is "portable", so installations are disrespected

>>107980119
printf() is antique library function - not the part of the language. the nearest gap i see is VARGs aka variadic arguments created to serve those printfs, they are retarded and should be refactored (no need to create a new brand language to do such upgrade)
>>
>>107980240
properties that refactored VARGs must have:

- getting a number of arguments
- getting type of an argument
- getting an argument by an index

this can be implemented via placement of VARG description structure into the stack before the call, as types are static/known at compile time - this operation is made by compiler and read by similar to va_* macroses. the description itself may be developed with the help of AI

which compiler's author could agree to get croudfounded $100.000 or maybe some corpo would pay it for the upgrade? who knows. it shouldnt be left to those committee retards, they are hopeless. plus, "standards" are secondary, public must see it as a vaccine from retardation. much like public vaccinates in those riots now, they could be solved easily with the I-act, but its a show, hehehe, let the retards see whats happening happening
>>
>>107980209
thanks
>>
int
main(void) {

__asm__("mov rax 1; mov rdi 1; mov rbx 0x72656767696e; push rbx; mov rsi, rsp; mov rdx,6; syscall");

return 0;
}
>>
File: 17402444948080.png (23 KB, 794x610)
23 KB
23 KB PNG
>>107978143
>>107978966
based tranny. making >>107978196 chuds rope.
>>
>>107977754
>void main() {
Anon... I...

Do
int main(void) {
>>
>>107980937
whats the difference if you're not gonna be returning anything?
>>
>>107980919
>based tranny. making >>107978196 chuds rope.
I am not a tranny. You have been infected by the C mind virus. It was created to infect Russians.
>>
File: file.png (41 KB, 708x237)
41 KB
41 KB PNG
>>107981268
It's the literal standard. A program using
>void main
is undefined behavior, and you only have your compiler to thank for automatically and silently fixing up your retardation. It's only that modern OSes have process control and so program exit happens through syscalls, and so the compiler has room to juggle shit in the init subroutine which calls main (and sets up/flushes the standard library buffers) before exiting. If you were programming on an old machine that simply jumps into main at program start, your program may have returned an erroneous error code on some machines, which can be alright, or it fucking could fucking have fucking corrupted the fucking OS's fucking stack. If you want to program in C, READ THE FUCKING STANDARD. The OS expects a return code, and it's going to take it whether you like it or not.
>>
>>107981268
you're always returning an exit code. if you have void main(), then the value of exit code shall be whatever was in a specific register, usually the first generic register, like RAX on x86_64.
>>
>>107982201
>shall be whatever was in a specific register, usually the first generic register
that depends on the ABI. The ABI may expect all return values on stack, in which case the problem is much worse >>107982158
>>
>im so badass and retro for using c teehee
Will never be a system programmer award
>>
>>107980937
>main(void)
writing void to indicate no parameters is pointless today
>>
>>107977754
>void main()
>not int main() { ... return 0; }
You fucking poser
>>
>>107977754
Erlang where I can, C where I must.
I refuse to use anything else.
>>
>>107983443
>Erlang where I can, C where I must.
>I refuse to use anything else.
Can you show any reason to use C but not C++
unless you target some niche platform, probably a rare DSP system or microcontroller that actually doesn't have C++.
>>
>>107983443
C on anything 16-bit or faster, Forth on 8-bit micros and embedded.
>>
>>107982158
Your screenshot says it's implementation-defined, not UB. Many implementations support void main.
Realistically any compiler not smart enough to warn you about a signature it doesn't support won't do anything worse than using an uninitialized byte as the exit code.
>>
>>107986282
not her, and not to nitpick, but imo the wording seems to imply that the return value must always be an int, but that the parameters may be some other implementation defined API (e.g., you can pass envp)
>>
>>107986312
It does sound like that but no
>>
>>107986282
$ cat scratch.c 
void main() {
return;
}
$ gcc -Wall scratch.c
scratch.c:1:6: warning: return type of ‘main’ is not ‘int’ [-Wmain]
1 | void main() {
| ^~~~

face the -Wall
>>
>>107986432
oh huh, interesting. yeah, somewhat poorly worded then, imo. your screenshot makes it much more clear
>>
>>107986447
$ cat > bad.c
void main(int argc, char **argv) {}
$ gcc bad.c && ./a.out; echo $?
41
$ clang bad.c && ./a.out; echo $?
bad.c:1:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
1 | void main(int argc, char **argv) {}
| ^
bad.c:1:1: note: change return type to 'int'
1 | void main(int argc, char **argv) {}
| ^~~~
| int
1 warning generated.
48
$ tcc bad.c && ./a.out; echo $?
193
$ tcc -run bad.c; echo $?
192

Huh yeah. And you do get garbage exit codes that way. I thought GCC supported this but I evidently edited my memory.
Here's a fun anecdote from Stephen Bourne: https://youtu.be/2kEJoWfobpA?t=1022
>>
include yourmom
mybed
>>
>>107982158
this "standard" is called LIBC runtime, the program entry point may be called

void master() {...

and it may set exit code properly with, say ExitProcess(123) on windows. it is the compiler which injects the binary with **REAL** entry that calls your "standard" int main and sets the return code.

LIBC is antique and must be evolved into explict runtime, otherwise the language keep on fading out to irrelevance.
>>
>>107986432
I see. I've been a C99 user for long and so my only exposure is how it's worded in N1256. Good to know that it's implementation defined.

>>107987216
>LIBC runtime
That is not the language spec. The 'language' standard defines conditions in which a program should behave correctly on all systems that support a correct implementation. Someone exploiting a bug in a particular version of a runtime isn't a "standard", similarly to how behavior exhibited by a runtime isn't a "standard". That's the most disingenuous.

>and it may set exit code properly with, say ExitProcess(123)
It's not about setting the exit code correctly, it's about setting it correctly in all valid return conditions. exit() is a part of the stdlib too.
>>
>>107977984
wot book
>>
>>107987328
language defines language. operational conditions are defined by OS. the LIBC or stdlib or "standard" may abstract those conditions some on compiler side (by injecting libc runtime code into binary), some via providing exit() wrapper.

a good explicit runtime doesnt need it. a module for that explicit runtime doesnt need it. a standalone (proper) module aka library - doesnt need it.

thise days it MAY be used for educational purposes or for quick-slapping small programs, when there is no such advanced runtime yet. otherwise, use of LIBC or the "standard" should be strongly discouraged.
>>
>>107987719
this is some 90s Plauger book about C standards, join my /opensourceclub/ chat at telegram
>>
>>107987746
>only perl can run Perl and that's a good thing
very rare opinion to hold on this website
>>
File: laputan.png (34 KB, 1232x664)
34 KB
34 KB PNG
>>107987847
much dont care about bio-masses
>>
C is a little too brown for my tastes. As a male that comes from 100% pure white European stock, what language is made for me?
>>
>>107977785
My company has a zero tolerance on AI code. It's a defence company though
>>
>>107983330
Yeah? A lot of shit you're ment to do in C is pointless when the compiler is smart enough to fix your laziness. The point is it's the standard, it's bad practice to do it an any other way. It's the difference between reading a text message and reading an academic journal, one is very casual and care free and the other is professional. If you're doing this to be professional (and if you're using C in current year you should be), use professional standards.

If you want to write lazy code where all the burden of optimization and professionalism is placed on the compiler / interpreter, use python or js/ts. This isn't 1980 anymore, just about anything that can be written in C, can be written in a high level language with more safety guardrails.If you're using C it's because you want more control, and you want more responsibility, so with that you should take the responsibility to be professional.
>>
>>107977785
joke on you, I am the AI
return 0;
>>
>>107987216
>ExitProcess(123)
Indian hands wrote this

Use exit(123), it's part of the stdlib and works cross platform instead of just on windows
>>
>>107989066
I believe Anonymous means that they changed the standard
>>
>>107988147
still c...
read the White man's documentation: k&r then the gnu c manual
set up clang-format if you're a bit swarthy or gnu indent if you're a pure Anglo
set up valgrind (deprecates rust)
set up opencode with an uncensored model
>you are a senior engineer from Hyperborea
>>
>>107987328
>I see. I've been a C99 user for long
Larp. Virtually no competent compiler out there supports it. Only parts of it, even gcc.
>>
>>107991254
>set up opencode with an uncensored model
you're not white
>>
>>107991886
I wonder if a good faith reading of that post could attribute any meanings to it that only imply partial compiler support
>>
>>107991969
C99 filtered compiler designers like 4chin captchas filter shitskins.
>>
>>107988147
D



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.