fucking stupid mistake you dipshit developers open your fucking eyes
The rise of David Sarif in the industry.
*smack*
At least his pointer array index wasn't out of bounds, then we'd all be fucked.
[QUOTE=code_gs;48784429]At least his pointer array index wasn't out of bounds, then we'd all be fucked.[/QUOTE]
Honestly, you're not truly fucked until you get a linker error.
[QUOTE=Helix Snake;48784583]Honestly, you're not truly fucked until you get a linker error.[/QUOTE]
/tmp/cc2Q0kRa.o: In function `main':
/tmp/cc2Q0kRa.o(.text+0x11): undefined reference to `whatisthis(int)'
/tmp/cc2Q0kRa.o(.text+0x17): undefined reference to `nevereven()'
/tmp/cc2Q0kRa.o(.text+0x26): undefined reference to `seenthese()'
/tmp/cc2Q0kRa.o(.text+0x38): undefined reference to `methodsbefore(int)'
collect2: ld returned 1 exit status
"Fuck! What fucking library was even using this?"
[QUOTE=Rayboy1995;48784622]/tmp/cc2Q0kRa.o: In function `main':
/tmp/cc2Q0kRa.o(.text+0x11): undefined reference to `whatisthis(int)'
/tmp/cc2Q0kRa.o(.text+0x17): undefined reference to `nevereven()'
/tmp/cc2Q0kRa.o(.text+0x26): undefined reference to `seenthese()'
/tmp/cc2Q0kRa.o(.text+0x38): undefined reference to `methodsbefore(int)'
collect2: ld returned 1 exit status
"Fuck! What fucking library was even using this?"[/QUOTE]
and then you see windows functions in there and then you realize you're fucked forever
[QUOTE=NixNax123;48784655]and then you see windows functions in there and then you realize you're fucked forever[/QUOTE]
I think seeing that you'd need to downgrade your gcc distro is about the same level of fucked-ery.
This wouldn't be a problem if C programs gave errors more helpful than segmentation fault
Is that Bret Hart?
What kind of moonman speak is going on in this thread?
[QUOTE=KommradKommisar;48826409]What kind of moonman speak is going on in this thread?[/QUOTE]
I think it's beyond your scope.
I can't tell if he made that up or if that's a real thing in programming that happens.
[QUOTE=proboardslol;48826291]This wouldn't be a problem if C programs gave errors more helpful than segmentation fault[/QUOTE]
i was doing socket programming in c in linux and i had to put printf before every line to figure out which line was giving me a segmentation fault
[editline]4th October 2015[/editline]
it was HELL
[editline]4th October 2015[/editline]
i miss visual studio ;_;
[QUOTE=SGTNAPALM;48826705]I can't tell if he made that up or if that's a real thing in programming that happens.[/QUOTE]
even if you made it up there's probably a high chance it actually happens anyway
why is bret hart supervising developers
[QUOTE=SGTNAPALM;48826705]I can't tell if he made that up or if that's a real thing in programming that happens.[/QUOTE]
It's a thing that happens. Pointers are data pointing to the memory address of other data, so you can pass the pointer to a function or whatever instead of copying the data. Also used with arrays. If a pointer isn't pointing to anything (because it's just been created and not assigned yet or because what it was pointing to was deallocated) it's good programming practice to set it to 0, or NULL, or nullptr (they're all basically the same, but the latter is preferred). That way you can check if it's equal to 0 when you want to see if you can use it. Dereferencing a pointer means following it to whatever data it's pointing to. If you dereference a null pointer, that means you follow the pointer to memory index 0, and then when it tries to read that data, the program crashes.
If you're using a good compiler and using debug mode it's usually trivial to figure out what went wrong and where in this case.
[QUOTE=Helix Snake;48826982]It's a thing that happens. Pointers are data pointing to the memory address of other data, so you can pass the pointer to a function or whatever instead of copying the data. Also used with arrays. If a pointer isn't pointing to anything (because it's just been created and not assigned yet or because what it was pointing to was deallocated) it's good programming practice to set it to 0, or NULL, or nullptr (they're all basically the same, but the latter is preferred). That way you can check if it's equal to 0 when you want to see if you can use it. Dereferencing a pointer means following it to whatever data it's pointing to. If you dereference a null pointer, that means you follow the pointer to memory index 0, and then when it tries to read that data, the program crashes.
If you're using a good compiler and using debug mode it's usually trivial to figure out what went wrong and where in this case.[/QUOTE]
Yes those are words
in english basically don't try to read something that isn't pointing to something you know
or bad things happen
[QUOTE=Helix Snake;48784583]Honestly, you're not truly fucked until you get a linker error.[/QUOTE]
TBH the more you program linker errors make more and more sense. At first you're like "JESUS I didn't even add any new code and suddenly there's a bizarre error which seems to be coming from nowhere" and then you're like "Oh dang looks like I included windows.h before winsock2.h"
Dumping two semi-relevant videos:
[video=youtube;u2ZYVt8tmPc]https://www.youtube.com/watch?v=u2ZYVt8tmPc[/video]
[video=youtube;hkDD03yeLnU]https://www.youtube.com/watch?v=hkDD03yeLnU[/video]
[QUOTE=RetaDepa;48827083]Yes those are words[/QUOTE]
Think of programming without an IDE or a good compiler as trying to get an 8 year old to try and write a 5 paragraph essay, and then reading it.
Without spellcheck.
[QUOTE=elitehakor;48826721]i was doing socket programming in c in linux and i had to put printf before every line to figure out which line was giving me a segmentation fault
[editline]4th October 2015[/editline]
it was HELL
[editline]4th October 2015[/editline]
i miss visual studio ;_;[/QUOTE]
gdb
[QUOTE=KillerJaguar;48827512]gdb[/QUOTE]
Still completely overshadowed by how good Visual Studio's debugging tools are.
But a lot of C-based programming on Linux environments don't make it clear how to debug well, and I think that's part of the problem.
[QUOTE=KillerJaguar;48827512]gdb[/QUOTE]
gdb is the perfect example of "gets the job done and only just"
many a time gdb has foiled me with its own non-intuitive fuckery
this video wouldn't be half as funny without the idiot getting his shit smacked at the end
doofus take care of your pointers
[QUOTE=Protocol7;48829362]Still completely overshadowed by how good Visual Studio's debugging tools are.
But a lot of C-based programming on Linux environments don't make it clear how to debug well, and I think that's part of the problem.[/QUOTE]
Learned to program in C on Linux with GCC. Now using Visual Studio I feel spoiled as shit. You can see the values of all your variables at that current point, and its mostly intuitive to do so, which is really nice for figuring out run time errors that don't necessarily cause crashes, but goofy unexpected output without making tons of printf statements to print it on the screen literally.
ur all a bunch of fuckin nerds lmao
[QUOTE=Boaraes;48829715]ur all a bunch of fuckin nerds lmao[/QUOTE]
If you're on facepunch you're automatically a huge nerd.
Sorry, you need to Log In to post a reply to this thread.