Well, Sup Forums?

Well, Sup Forums?

Other urls found in this thread:

insecure.org/stf/smashstack.html
google.com/amp/s/www.cnet.com/google-amp/news/which-country-has-the-best-programmers-hint-its-not-the-us/?client=ms-android-americamovil-us
hack.org/mc/texts/classic-multics.pdf
homes.cs.washington.edu/~levy/capabook/
yegor256.com/2015/08/25/fail-fast.html
menuetos.net/
redox-os.org/
cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/string/strlcat.c?rev=1.18&content-type=text/plain
cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/string/strlcpy.c?rev=1.15&content-type=text/plain
en.wikipedia.org/wiki/Morris_worm
twitter.com/NSFWRedditVideo

What is C?

C++
Should've used C instead.

DELET

html

sounds like C/C++

Sepples

What is C++?

>C++
>imperative

JavaScript

C

Will 2017 be the year of the Rust Compiler?

>I struggle with taking care of memory management and security so I'll say the language sucks to save my self esteem
kek

>LLVM backend

/thread

>one language stands out as bad
>"lol it's the programmers' fault for being used to the other languages!"

>im used to one language
>all languages must be like the languages im used to because i struggle with adapting to changes
LOL
:3

Your language does suck when its own standard library can fuck your memory up unexpectedly, won't give you a proper way to detect when strings have been truncated, and sometimes won't even NUL-terminate them.

You don't even have to look at modern languages like Rust to see how C sucks. Take a look at fucking Pascal, for example. It simply stores the length of your array/string so it knows its bounds. It's not so hard to implement. C has really no excuse.

>Your language does suck when its own standard library can fuck your memory up unexpectedly,
you fuck your memory up unexpectedly*
>won't give you a proper way to detect when strings have been truncated
they dont get truncated, you do that yourself
>and sometimes won't even NUL-terminate them.
all string operations and functions do that

I looked at both Pascal and Rust and realized why they failed and C stood on top. C allows the non-retarded to make their own choices and it's capable of doing non-blocking I/O unlike Rust. People who are competent in programming love C/C++

No, you're just making it evident to everyone that you've never really done any serious coding in C.

>you fuck your memory up
I didn't write strcpy, or strcat, or getwd, or gets, or scanf, or sprintf.

>they dont get truncated, you do that yourself
No, strncpy and strncat do it.

>all string operations and functions do that
You've never used strncpy and strncat then. They randomly decide to not NUL-terminate your strings.

>m-muh language is purrrfect it has no flaws stop criticizing it!
Stop already, you're just embarrassing yourself.

my favorite language is better than your favorite language. deal with it, retards

>I didn't write ...
all of those functions add null terminators, sounds like you're just making stuff up to keep your argument on its feet, its failing btw
>i hope telling him he's embarrassing himself will help me save face
lmao
its ok user, maybe you'll have better luck in the next argument

It's made for programmers. As in people who know how to program. Not some script kiddies and wannabes who "learned" to program in a shitty college, a coding camp or an online tutorial site. You can't program if you're lazy and not intelligent. If you are, then stick with python or drag and drop "coding" software.

>sounds like you're just making stuff up
Try
char str1[]= "Niggers tongue my anus";
char str2[40];
strncpy (str2, str1, 5);
printf("%c\n" , str2[5]);


I know you won't try it because you're not even a real programmer, just a troll, 'cause if you were, you'd know this, but I'm replying just so the unwary out there doesn't end up believing your horseshit.

No, it's made for attackers. It makes their lives heaven. They have a myriad of stack smashing and buffer overflow vulnerabilities to exploit.

You do know there is strlcat and strlcpy you know?

Alright then...
void
fuckup (char *str)
{
char newstr[80];

strcpy (newstr, str);
}

int
main ()
{
char c, buf[4096];
int i=0;

while ((buf[i++] = getchar ()) != '\n');

i=1;
fuckup (buf);
i=2;

printf("i = %d\n", i);

return 0;
}

Compile and run. Input 160 characters. Marvel as you watch i = 1 being printed.
insecure.org/stf/smashstack.html

What kind of shit language skips an instruction like above?
Stop rationalizing it, C is dogshit. It was acceptable 40 years ago. Now it's legacy crap. Enjoy your buffer overflows, faggot.

Now who's making shit up?

It's a kludge function available only on some fringe hobbyist platforms.

C is still shit, and the fact they have to come up with makeshift half-solutions like these only proves it further.

It's a replacement for c's strncpy and strncat, you need to reimplement them if you aren't using bsd, the source code is available, quite trivial to make a static library out of the.

*them

So wait, what language would you use to make an OS or at least the kernel with?

>it added a null terminator
lmao
its ok to admit that a language is too hard user, you cant change your IQ, no need to beat yourself up about it.

Google strlcpy and click the third link from the top, that will explain everything

From this guy's link...
>The most common misconception is that strncpy() NUL-terminates the destination string. This is only true, however, if length of the source string is less than the size parameter.
Your string was probably initialized to 0 already.

A language that doesn't randomly skip an instruction I gave it.

>1949+68
>Being an English speaking programmer
You've all been beaten by the Chinese who are doing it better and cheaper, why do you nerds even bother?
google.com/amp/s/www.cnet.com/google-amp/news/which-country-has-the-best-programmers-hint-its-not-the-us/?client=ms-android-americamovil-us

>It was acceptable 40 years ago.
C was never acceptable because there were better languages before C even existed. 1977 was 40 years ago. Multics was already over a decade old. There were a lot of advances in computer security since then, like capability systems, but C-based OSes today completely ignored that and are still less secure than Multics.

hack.org/mc/texts/classic-multics.pdf
homes.cs.washington.edu/~levy/capabook/

"New" C features are still being poorly copied from languages older than B and C. For example, _Generic and compound literals.

I don't think anything did as much damage to OS design, hardware design, and computer security as C and C-based OSes.

>I looked at both Pascal and Rust and realized why they failed
Pascal failed mostly because Borland were fucking idiots and nobody else used it

Was comfy to work with back in the day as it made GUI bullshit easy without being useless and annoying the way visual basic was (and interfacing with C code was super easy)

C# and Swift fill that role now

>copy 4096 char buffer to 80 char buffer
>program crashes

imo it works as expected

I never understood why Borland never open-sourced old Delphi versions like they did to InterBase.

It doesn't crash, it skips an instruction.

Programs ought to fail fast, not be fail safe: yegor256.com/2015/08/25/fail-fast.html

What is c
Got a good kek out of this

Safe way for using strncpy and strncat.

strncpy(path, homedir,
sizeof(path) - 1);
path[sizeof(path) - 1] = '\ 0';
strncat(path, "/",
sizeof(path) - strlen(path) - 1);
strncat(path, ".foorc",
sizeof(path) - strlen(path) - 1);
len = strlen(path);


Same thing using strlcpy and strlcpy without error checking.

strlcpy(path, homedir, sizeof(path));
strlcat(path, "/", sizeof(path));
strlcat(path, ".foorc", sizeof(path));
len = strlen(path);

>being incompetent and claiming it's the language's fault

>being incompetent at designing a language and then claiming it's the programmer's fault when it fails

Finally someone understands. C was designed by noobs, just like PHP.

Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither.

>Hit yourself with a hammer
>"Lol it was da hammers fault"

Where is the counterfeit stuff on here so I can get it

>hit nail with hammer
>hammer explodes
>"lol it was your fault"

Disable memory protection on your CPU then, faget.

It is. You were given a clear set of rules and functions, your inability to comprehend them suggests that you're stupid. This is almost like hearing retards cry about math not being logical.
>I don't know this, therefore it makes no sense!

>no C
>no Windows
>no Linux
>no Apple to steal the language and make object C, thus no MacOS
How would you even be on this site without it?

Assembly.

Asssembly.
>just for memes
>menuetos.net/

>cry about math not being logical
>implying promising to nul-terminate your strings and then not terminating them is logical

>I don't know this
If anything, I've shown you I know it better than you do. I've given actual examples of C's misbehaviour.

>MacOS
MacOS was written in Pascal until version 9, you nescient dumbass.

>no Windows
How is this bad?
>no Linux
This keeps getting better!
>no Apple
Goddamn awesome!!!!

What is C/C++
Absolute garbage, especially compared to python/java, fuck, anything else is better

>toddlers needing to be handheld through programming complaining about mundane shit again
never gets old

Any language can be used to make an OS.

redox-os.org/

>It doesn't crash, it skips an instruction.
and what instruction does it skip?

idk it works for me

Assembly is too abstract. You'd have less than 100 people working on it.

>le all operating systems are bad meme xd
Do you use MenuetOS?

No, I use TrueOS.

>GNU style
Throw yourself off a cliff.

>to many

>HUR DUR I CAN'T FUCKING PROGRAM PROPERLY THEREFORE C IS SHIT
Jesus christ m8. Just fuck off please. This is easy shit.

>Copy 4096 char buffer to 80 char buffer
>Surprised that bad stuff happens
Such is life as a retard.

For strlcat
cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/string/strlcat.c?rev=1.18&content-type=text/plain

For strlcpy
cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/string/strlcpy.c?rev=1.15&content-type=text/plain

Here's how a normal programming language responds to that:
ERROR: array out of bounds

Sure, a security expert who exploits buffer overflows for a living can't program. Keep telling yourself that.

You sound frustrated.

Programming isn't an individual effort.

Even if you're a perfect programmer and make no mistakes in the course of writing thousands of lines of code (improbable), some dickhead on your team is inevitably going to fuck up. C was a good upgrade from assembler, but now we have projects so complex that it's hard to make sure no one on any team makes any mistakes.

Rust is the language of the future. Feel free to stay stuck in the past with C though, I'll look at you the same way I look at COBOL programmers.

>how a normal programming language
>Compilers are languages now
retard

>They have a myriad of stack smashing and buffer overflow vulnerabilities to exploit.
which will not work because of stack canaries and also because of two null bytes in 64bit addresses which kills any chance of abusing functions that cut off at the first occurance of a null. go ahead and try your rop games on 64bit, trying to exploit trivial stack based buffer overflows and you'll see they fail, check the stack after and its fucked up and your pointers look unaligned. and besides that those vulnerable functions are switched out for the ones suffixed with "_chk" in newer gcc versions which if abused the process exits just as if you smashed a canary. the point is no one but idiots use those vulnerable functions today and if you did canaries and bounds checking versions are used instead in newer compilers

...

>his language is so shitty it needs a bunch of patches around it to make it barely safe

>Here's how a normal programming language responds to that:
Ritchie didn't have retards in mind when he designed C. Sorry.

>Sure, a security expert who exploits buffer overflows for a living can't program.
Security expert or not, you clearly can't program as proven by this post: Only a retard would write up this code and complain about it not working as intended.

Your complaining is like inserting random calls to exit() and then complaining that your program exits.

If you tell C to do something stupid then it'll do it. it's not the languages problem that it did it, it's YOUR problem for being a stupid fucking retard who can't program properly.

No one who can program properly gives a shit about all this safety nonsense, not programming like a retard kind of helps. I don't have these problems myself.

>Here's how a normal programming language responds to that:
It's compiler and IDE dependent. I'm sure Visual Studio would display such an error.

this

What is C#?

>I don't have these problems myself.
Yeah, I'm sure you, some random anonymous dude from a Crimean matryoshka image board, write perfect, non-buggy, buffer overflow-free C software.

>Ritchie didn't have retards in mind when he designed C.
Unix software is full of buffer overflows. Is everyone who worked on Unix a retard?
en.wikipedia.org/wiki/Morris_worm

>Only a retard would write up this code
It's an example, you fucking moron!

This happens in real-world applications in much less obvious occasions, such as with user input!

Gosh, you better be a troll! I hope you're just pretending to be retarded!

Here's how a normal programming language responds to that:

>ERROR: array out of bounds

annex K for C11 is not supported by compilers as it was considered harmful

btw i love how even basic c++ programs have over 1MB of bloat

Using LLVM is the only thing Rust has done right desu.

>randomly
Only if you didn't read its definition. strncpy(dst, src, n) copies n chars of src or strlen(src) chars, whichever is lower. If the length of src is smaller than n, the remaiming chars are set to 0.

I'm learning C++ for my first language. Should I just stop and pick up python instead?

>Rust is the language of the future

Right, it is, and it will always be the language of the future, because all the best features are just right around the corner... any time now, it's going to be great, just wait and see. Next week, they'll be right around the corner there. Next month, they'll be just right there, almost done. Next year, they'll be right there for sure, just a bit more time.