[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Ban C

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 322
Thread images: 18

File: 1488491035624.png (96KB, 1920x1012px) Image search: [Google]
1488491035624.png
96KB, 1920x1012px
C apologists are NSA shills plain and simple. Rust makes it harder to produce vulnerable programs as it actually implements safety precautions like Bounds checking, dangling pointer prevention, data race prevention, lifetimes etc. This is against the interest of the NSA and so they are shilling C so that people continue to produce exploit prone, unsafe and vulnerable programs.

Ignore the NSA/C shills. Programming in C should be banned and outlawed.
Say no to security exploits, say no to the NSA. Your data and your privacy is worth preserving.
>>
>>59213307
or just do C++ and enjoy a not meme language.
>>
That's the most retarded example I've ever seen used.
>>
>>59213336
http://hmarco.org/bugs/CVE-2015-8370-Grub2-authentication-bypass.html
>>
>>59213343
Unsigned integer underflow can happen in many languages
Nonetheless, still a much better example than OP's image.
>>
Who cares about C/C++. If you don't know assembly you aren't a real programmer.
>>
>>59213307
Id love to use something else. But no suitable replacement exists.

Rust is pure distilled shit.
>>
>>59213307
>ban c
>ban Windows
>ban macos/osx/fuckoff
>ban linux
>ban just about every kernel
>ban every embedded device
>ban a shit ton of languages like java and some interpreted ones as well
goos job you just broke half the world and set us back 30 years in technological innovation
>>
>>59213307
What am I looking at here?
>>
>>59213415
C's retardation
>>
>>59213307
I too like it when my compiler tries to split a single line into multiple lines. I'm sure you think that the C version is not intuitive, but if you use your brain for a second you'll realize that the fucked up autosplit bullshit that Rust is trying to do on the bottom will make it easier for logic errors to creep into the code.
>>
>>59213427
/g/, everyone
>>
OR we could just make it illegal to be a white male developer. All of the current problems in tech result from decades of white supremacy and patriarchy in computer science.
>>
>>59213422
Wow, A+ explanation. You should go into teaching.
>>
>>59213427
Do you have any idea what you are talking about, C toddler?
>>
>>59213446
No. You should uncuck yourself and your family with extreme alt right sieg heil red pilled anti nigger aryan god verse :D
>>
>>59213440
>>59213452
>variable changes mid fucking function
That's great. I like that. It gives me the warm and fuzzies the same way that using gotos to jump in and out of for loops does.
>>
>>59213307
>trying to decrement something after you already displayed its value
Uh, can someone tell me how this is C's fault?
>>
1. Completely outlaw C programming, seize all C books and burn, delete and shred them.
2. Rewrite everything into Rust
3. Kill C(ommunism)
>>
>>59213492
--x decrements before it's used.
--x is like
x = x -1;
//call

whereas x-- is like
//call
x = x -1
>>
>>59213514
I didn't know that, explains why they're both 14 and not both 15. Still, it seems to me the problem could be solved by not trying to do this at the same time.
>>
>>59213542
Or how about solve this undefined behavior by actually defining the sequence like every sane language

>C people
Oh wait, they are mentally ill.
>>
>>59213560
It really doesn't seem like a big deal.
>>
>>59213492
It's a long story kid, sit down for a sec.

In the beginning, people had switches that were wired up to work like calculators. Then Steve decided it was a good idea to try and divide by zero, and the whole thing burned down. That's when we invented null - aka "fuck steve".

So a few decades later and people forgot why we had null, and why they were seeing "fuck you and fuck steve" on the screen everyday. So they looked it up and said "wow couldn't you guys have just refused to let a division by zero through", and that's when we had exceptions.

Few years later, the pajeets start coming in and none of them wrote a goddamn thing to explain their 99% hardware dependent code. By this point people were businessmen more than developers (thanks Bill and Steve) and they decided to throw an exception for every little thing that pajeet wasn't supposed to do.

Fast forward to today, people expect computers to not allow them to be pajeets. It very much defeats a lot of the hippie pioneering computing spirit of the early days, but BOY is it more productive.

Yet despite all these safeguards, something always lets pajeets be pajeets, and it's very much the same thing that lets people break things and find brilliance where none existed.

That said, OP probably shits in the street regardless of ethnicity.
>>
In accordance federal law Rust's Evangelion Unit-0[failed to parse manifest at `/Users/stopshillingrust/Projects/rust/hello/Cargo.toml`] has been deployed to enforce the porting of Linux and FreeBSD to rust. failure to comply will end with death
>>
File: 16681988.jpg (22KB, 399x225px) Image search: [Google]
16681988.jpg
22KB, 399x225px
>>59213586
>Undefined behavior is not a big deal
>>
>>59213593
I don't know what that means. What's so hard about doing this in discrete steps? Would that not work?
>>
>>59213590
>Some lonely autist actually wrote this pasta
>>
>>59213608
That'd work. However in every language that I know it's actually well defined behavior and people use unary operators like that time to time.

If you got a hole in your direveway you are not going to fix it by avoiding it, you fix it by filling up the hole
>>
>>59213609
shit I think I missed 2AM at /jp/
brb
>>
>>59213645
NSA pls go
>>
>>59213649
I'm just poking fun at OP because he's a hipster faggot who hangs out on news.ycombinator.com and posts shitty articles about how you should ditch mysql for your next startup and use some retarded shit written in ruby on dicks on rails running on a ti-83 with a cassette recorder as the storage medium.

c works nigger. "mah security" is entirely doable if your not a tard and know what the fuck you're doing.
>>
>>59213687
>c works nigger. "mah security" is entirely doable if your not a tard and know what the fuck you're doing.

Judging from the longstanding track record of vulnerabilities in major projects written in C by people with more experience than the average /g/ shitposter, the only real conclusion to draw from this is that C programmers are tards or programming in C makes people retarded.
>>
>>59213687
Hipsters cling to retro stuff. Like C
>>
>>59213687
NSA LEAVE NOW
>>
>>59213725
C people are mentally ill
>>
>>59213645
Is that a balls?
>>
>>59213747
>image.jpg
>macfaggot
Yes
>>
>>59213307
dat simplicity
>>
>>59213773
yeah, simply undefined
>>
>>59213736
lets hear about that great project you're writing in go thats gonna revolutionize how people think about toilet reading on their iphone
>>
>>59213799
>Get BTFO in his own claim
>Changes the topic
>Says I use Go
wew lad 3/3
>>
File: kek.png (59KB, 576x507px) Image search: [Google]
kek.png
59KB, 576x507px
>>59213814
>takes the bait
>> "BTFO"
>>
>>59213736
>news.ycombinator.com
Install PostgreSQL
>>
>>59213840
>I was pretending to be retarded
C people are autistic af
>>
MUST BE THE 'TISM!
>>
>>59213687
Ebin argument, NSA. By your logic people that use C are hipster faggots that cannot use B
>>
>>59213622
It seems more like a personal preference thing.
>>
>>59213876
>cannot use B
>/B/?
FUXXIN X86 OPCODES DIRECTLY ONTO YOUR 3.5" FLOPPY BEEITCH!
>>
>>59213892
>I prefer to pretend broken function calls do not exist
How low do you have to fall for defending this?
>>
>>59213307
>C apologists are NSA shills
oh boy he's reaching
>>
>>59213903
I guess I just don't understand how it's broken.
>>
>>59213903
It's undefined in C# as well.
>>
>>59213930
plain and simple
>>
>>59213937
care to post a screenshot? Java has this properly defined.
>>
>>59213383
>>59213343
It's not a better example for OP, because his task is to shill Rust, not discourage use of C, and GRUB can't be written in Rust.
>>
>>59213307
Enlighten us filthy heathens with your woke AF brogrammer wisdom? Tell us what languages we should be using, maybe suggestions on editors as well. Tabs or spaces? suggested indentation style?
>>
>>59213307
Well, if you can make Rust actually readable by human beans, I will use Rust. Until then, I will continue developing my applications in Python, Lisp, and C.
>>
>>59213307
>I write shitty code, therefor C is shit
The order of evaluation is left intentionally undefined so compilers can make optimizations. You're altering a piece of memory while using it somewhere else and expecting it to be isolated. That makes you retarded, and shows how little you understand of memory, pointers, and C. It also shows why Rust will never replace C, because Rust supporters don't understand C.

>roads are bad because walking into the street is undefined
Yeah, sometimes you'll be fine, and sometimes you'll be hit by a car. That doesn't make roads bad, it just makes you a fucking idiot for not understanding why you should stay in the fucking crosswalk.
>>
>>59213903
To be honest it seems to me like the c++ version is broken.
>--n detected
>pass variable = n-1 to both arguments for <procedure pointer for printf>
vs
>--n detected
>pass variable n to first argument in <procedure pointer for writeln>, n-1 to second argument of <procedure pointer for writeln>

In fact, if you think about it, it could be that writeln (because it is a std library function based on - this is imporant - STREAMS) is a function that makes multiple (recursive possibly) calls based on the number of arguments, so one writeln call with multiple arguments is actually treated multiple calls, hence why printf is considered one call (due to its implementation) and writeln multiple.

The key here is that C++ introduced the concept of streams, which is probably what caused all this. It's an issue of implementation, not the language itself being deficient.
I'd test this or look at the compiler code but im old and it's late.

I know for a fact that compared to the relative simple implementation of C, C++ had a lot of relatively advanced (for the time) concepts, and you definitely notice it in the way they tried to structure everything (OOP eh lads? wink wink) as opposed to "make code do this".
>>
File: 1471179837428.webm (282KB, 250x432px) Image search: [Google]
1471179837428.webm
282KB, 250x432px
>>59214014
>GRUB can't be written in Rust.
why
>>
>>59214065
/thread
>>
>>59213331
c# is where it's at senpai
>>
>>59214065
>I write shitty code
Classic NSA defense anthem. Creating bugs doesn't turn people into a shit programmer. Rust is very strict in areas that C does not. It's helping to prevent but but of course this hurts NSA drones
>>
>>59214122
He's shitposting
>>
>want to use Rust
>Rust SJW devs say I have to cut off my dick first
>>
File: 1459798031656.png (20KB, 713x173px) Image search: [Google]
1459798031656.png
20KB, 713x173px
>rust
yeah no

Pic related, it's idiomatic rust code from that programming language speed competition site.
If this counts as idiomatic rust code, I'm going to stay away from it.
>>
>>59214173
>idiomatic code should look like C
wow NSA is getting desperate
>>
>>59214173
Show me an example of macro in C
>>
>>59214173
It's amazing how perl is tucked away as a "please avoid all the mistakes of perl" while special characters and abbreviations of all sorts of shit are still acceptable.
I'm not trying to propose a solution but look at this shit. Look at it. There's no such thing as "programmer legible", only "C legible" or "java legible" or "ruby on dicks legible".
>>
you're smart op. too bad no one will believe you. It's been quite a lot of work suppressing newer and better languages, keeping up the status quo. Nice try kiddo, but you aren't going to stop us. oh, by the way, you may want to keep an eye on your Risperdal, pharmacists are clumsy sometimes.
>>
>>59214173
show the C equivalent, i'm betting it's not much better
>>
>>59214194
>>59214235
He's not going to
>>
>>59214122
>>59214141
It's because rust environment is too heavy to feasibly use Rust program as a bootloader.
>>
>Programming in C should be banned and outlawed.
No programming language should be banned or outlawed, even if every program it produces is insecure. The practice of programming should have little to no regulations.
>>
>>59214350
Fucking retard I bet you also think bootloaders == grub

https://github.com/lukehinds/rustOS
>>
>>59214350
https://lwn.net/Articles/641244/
if python can do it...
>>
File: 1427347888416.jpg (37KB, 400x320px) Image search: [Google]
1427347888416.jpg
37KB, 400x320px
>>59213307
Linux is written in C
Linux includes code written by the NSA

Coincidence?
>>
File: 1460933609082.png (200KB, 547x402px) Image search: [Google]
1460933609082.png
200KB, 547x402px
>>59214384

I agree and I am not being ironical despite the image.
To ban it there would have to be some sort of committee that would come with boatload of unintended consequences. Best thing about computing in general is that there is hardly any restrictions of who can do what and how. I'd argue it's the reason why the field thrives among seemingly stagnant economy.
>>
>>59213307
>this thread
>again

>doesn't understand that --n decrements n before any other part of the line is processed
>blames own stupidity on C
>Whaa why won't it do what I mean
You're like those whining feminists that join CS only to give up the first time there's a lab that's more complicated than printf() with no variables.
>>
>>59214527
n was called before --n
>>
>>59214545
Do you actually understand what a call is or are you just here to shitpost
Be honest, we already have an ANCAP ball posting tard here. There's no shame to it.
>>
>>59214606
Top quality argument, anon
>>
>>59214401
Grub is a bootloader, as it clearly advertises itself to be.

Also your link has barely any code (which means it's not shown to properly support all of Rust functionality), nor any instructions how to run it.

>>59214431
It is run from bootloader, not a replacement for a bootloader.
>>
>>59214646
Grub is one of many bootloaders, idiot
>>
>>59213307

3 stages:

>why am I so bad at writing C code?
>maybe I'm the wrong gender after all, I think I might be a girl
>hi guys have you heard about Rust?
>>
>>59214660
Did I claim that it is the only one anywhere?
>>
>>59214663
10/10
>>
>>59214663
Typical NSA tailored response:
>You are making bugs and this means you are bad at programming XD
>>
>>59214401
Actually, now that I look closely.

>https://github.com/lukehinds/rustOS/blob/master/src/lib.rs
>#![no_std]

If that means what I think it means then you little code snippet only proves my point further that rust environment is too heavy to use it without OS.
>>
>>59214663
C programmers are digital bug chasers
https://en.wikipedia.org/wiki/Bugchasing
>>
>>59214683
You can't expect anyone to believe you're honestly against C bugs when your every thread is an obvious Rust shillfest.
>>
>>59214704
as I said before
Rust is helping to prevent bugs but of course this hurts NSA drones
>>
>>59214715
Rust isn't helping to do anything. Rust is not being used. Rust documentation is a mess, to develop in Rust you have to become a part of a community, and and Rust community is something no sane person would want to be a part of. You're shilling for Rust, very clearly; there are plenty other languages that can work as C replacement and don't suffer from Rust's shortcomings.
>>
>>59214545
>I read left to right so the compiler reads left to right
Typical brainlet mentality.
>>
>>59214683
>>59214699

Have you started on hormones yet?
>>
>>59214699
>https://en.wikipedia.org/wiki/Bugchasing
>"Fuck of death" redirects here. For the Slaughter song, see F.O.D. (Fuck of Death).
...
>>
>>59214746
Top autism,

>I wrote the function top to bottom so the compiler reads it top to bottom
>le brainlet mentality :DDDDDD
>>
>>59214715
https://blog.ntpsec.org/2017/01/18/rust-vs-go.html

>Then I found out that a feature absolutely critical for writing network servers is plain missing from Rust.
>Contemplate this bug report: Is there some API like "select/poll/epoll_wait"? and get a load of this answer:
>We do not currently have an epoll/select abstraction. The current answer is "spawn a task per socket".
>Upon further investigation I found that there are no proposals to actually fix this problem in the core language. The comments acknowledge that there are a welter of half-solutions in third-party crates but describe no consensus about which to adopt.
>>
>>59214745
>Rust's shortcomings.
like?
>>
>>59214778
>Rust documentation is a mess
>>
>>59214778
Outlined in my post.

And here's more for you from a source that isn't some anon on 4chan:
https://blog.ntpsec.org/2017/01/18/rust-vs-go.html
>>
>>59214784
what mess?
https://doc.rust-lang.org/
>>
>>59214350

>It's because rust environment is too heavy to feasibly use Rust program as a bootloader.
Where Rust is used for extremely low-level tasks, the standard library is not used. Instead, there is libcore, which more or less provides a bare minimum set of functions that make no assumption about how memory is allocated, and even that's not technically needed. Rust is more than capable of being used as a bootloader. Or at least it is as much as C is. Personally, I have the view that anything that executes before the OS is even loaded probably ought to be done in Assembly, as it often involves a number of tasks that are married to the specific instruction set architecture, which may require instructions not generated by any normal compiler.
>>
>>59214778
There are crates for temporary workarounds while this gets fixed by the core developers, what are you trying to prove here?
>>
The shills are trying new tactics. Interesting.
Its not working though :^)

Enjoy your hormone therapy, you failed human beings.
The rest of us will be actually doing something with our lives.
>>
>>59214814
meant for >>59214776
>>
>>59214814
Trying to prove that the language is not yet ready to be used. Hoping the fag would stop spamming /g/ with threads about it.
>>
Anti Sec says no.
>>
>>59214829
That does not prove your claim at all
>>
>>59213307
I dont see what's wrong with that code? It does exactly what its told to.
>>
>>59214834
You literally admitted that things need to get fixed by the core developers.
>>
>>59214844
It was told to print 15 and one less than 15 in a proper, left to write sequence
>>
>>59214846
And?
>>
>>59214855
To me, if there are things that still need to be fixed in language, it means that language is not read for use.
>>
>>59214869
Do you have any idea how many fixes are waiting in C++ while it is used in production environment?
>>
>>59214849
Dear Anon, I know what it was told. But the programmer is not aware how functions are called in C or how expressions are evaluated.
>>
>>59214849
I find the C one more readable desu. Clear separation of text from variables.

If you want proper left to write output, why not just use C++ ?
>>
>>59214875
>how expressions are evaluated.
wrongly? yes
>>
Pascal is better than C, prove me wrong.
>>
>>59214872
C++ is the standard, unlike Rust it does not have a single team working on a single implementation. Changes to the standard are not fixes.
>>
>>59214881
No, OP just has brain damage.
>>
>>59214880
>Clear separation of text from variables.
you do realize D can do that full well, right?
writefln("%s %d", "string", "n");
>>
>>59214882
No way to define variable length string type.
>>
>>59214886
So when C/C++ has bugs they are "standards" and for Rusts they are bugs?

C people are mentally ill
>>
>>59214890
Huh, cool.
It's still has GC tho
>>
>>59214887
Are you upset?
>>
>>59214905
There are no bugs in the standard, only bugs in the implementation.
>>
>>59214918
>There are no bugs in the standard
I see you have been baiting me pretty well
>>
>>59214896
>what is PChar
>>
>>59214912
Why? Most people dont know they have brain damage. They should be thankful if someone tells them they do.

Having cancer and not knowing it is worse than having cancer.
>>
>>59214930
C(ancer)
>>
>>59214926
Not him, but how? Could you name some?
It's a document, how can it be buggy?
Undefined behavior isn't a bug.
>>
>>59214926
Standard is a book. Yes, there are no bugs in the standard, which should be quite obvious. I honestly find it fascinating how you find it in yourself to keep insulting others after embarrassing yourself over and over.

>>59214930
Not a part of Pascal; one of extension in either Borland or FreePascal.
>>
>>59214934
>every OS out there is written in C
>every low level library is written in C
>every driver is written in C
>every AAA game is written in C, compiled with C++ and no, they dont use std::vector, if they do, they arent AAA gamedev company.


Legend says Dennis Ritchie never made C, he just stole it from creators of the universe
>>
>>59214936
https://locklessinc.com/articles/10_problems_with_cpp/
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#Open%20Status
>>
>>59214941
You are the one who's controlling the damage pretty hard.

Were you the one who posted the Rust vs Go blog and used it against Rust? Hope you see they are not really using C as well.
>>
>>59214952
Not a single of listed issues can be classified as a bug.
>>
>>59214945
>every OS out there is written in C
Typical C toddler, everyone
>>
>>59214974
That should have been quite a big read to come to that conclusion within a few minutes
>>
>>59214973
Discouraging use of C is somewhat OK in my book. I am only against shilling Rust, which is what this thread is all about.
>>
File: 1487776988114.png (60KB, 645x968px) Image search: [Google]
1487776988114.png
60KB, 645x968px
>>59214945
>every OS out there is written in C
>>
>>59214988
I can say that without reading because those are issues in the standard, not in implementation; implementation can have book, standard can't, because standard is not a computer program.
>>
>>59214999
>I can say that without reading
I know. Freedom of speech amirite
>>
>>59213307
--n is prefix decrement meaning in machine code, n is decremented prior to execution of the print. C's is a more expected result desu.
>>
>>59215006
No.
>>
>>59214130
Ya'know, the more you rust guys force threads like this, the less people are gonna like rust. Unless that's your intent...
>>
>>59215014
printf()

The contents inside the parentheses get processed at first. The strings are written and processed from the left to right. On that case n should be read before --n because n corresponds to the frist %d
>>
>>59215030
>You want a program that is is less likely to have exploits?
Use Rust
>You want a program to barely compile with thousands of (((meaningless))) warning message that does not indicate any potential exploits
C

C enables compiling for retards. C is communism
:^)
>>
>>59215034
>The contents inside the parentheses get processed at first
>thinks operators are only allowed to mean one thing
let me introduce you to *...
>>
>>59214952
>first one
That's more issues with the design, not really bugs.
It's more a feature really :^)
>second one
That seems to be them fixing the document's wording to better represent C++. Not really bugs.
>>59215034
No that's not how a prefix -- works my dude. It is incremented before anything else, literally before anything else. OP should have used n - 1 if he wasn't retarded.
>>
>>59215063
>let me introduce you to *.
Ebin counter argument anon
>>
>>59215034
Lmao, those are just parameters to a function. They get evaluated prior to them being passed to printfn().

I know you are baiting.
>>
>>59215067
>It is incremented before anything else
No in D, Java, Go, Ruby and thousands of other languages.

Do C people like to live under rocks?
>>
>>59215055
You are ignoring the actual point he is making. Before the daily shilling started, I was neutral towards Rust, Go, D, and other languages trying to replace C. Now I loathe Rust. It's your achievement and your alone.
>>
>>59215078
>point "he" is making
>Now I loathe Rust.
You are getting really desperate there, may be throw in posts like >>59214945(yourself)
>>
>>59213307
>import std.stdio
>writeln


it's like you're also programming in java & python and are also mentally disabled
>>
>>59215076
see >>59215077
>>
>>59215092
XDDDDDDDDDDDDDDDDDDDDD TOP ARGUMENT BRO UPBOAT HERE ECKSDEE
>>
>>59215087
You're confused. Yes, there actually are at least two people in the thread who are against Rust spam.
>>
>>59215095
Durr what is pass by value hurr.
>>
>>59213307
Works fine for me in C.
What's going on?
>>
>>59215103
>Rust spam.
I know full well you are one of the known C apologist, anon
>>
>>59215087
yes, two different anons hate rust because of your threads retard.
>>
>>59215108
Not even C++ has this problem
>>
>>59215111
Is anyone who is against Rust specifically a C apologist in your eyes?
>>
>>59215077
Jesus you have to be baiting.
It is incremented before anything else in C, C++ and any language close to metal, because it's pretty much what a computer does.
Prefix-- is a fucking assignment operator you mong. do the same with n -= 1 and you will get 14, 14.
If you are going to bash C at least fucking understand how it works.
Of course you don't though, that's why you spend all your days making anti-C threads.
>>59215078
This, I used to think Rust was kinda cool. Then the shills came. At least D shills aren't near as obnoxious.
>>
>>59213307
Why did write new line when I didn't tell it to write new line? Rust is that garbage?
>>
>>59215110
Does it?
int i = 3;
Will i, --i, --i print 3 2 1?
>>
>>59215119
Tell me, why is it a problem?
>>
>>59215127
>writeln
>ln
>this is Rust
Dumb C toddler kys
>>
>>59215125
C++ actually has proper streams so the problem does not exist for C++
>>
>>59215134
>Does it?
It does.
>>
>>59215142
I don't actually know other languages other than C, all others look like poo in the loo to me.
>>
>>59215157
Well, time to take a shower and get out of that basement, anon
>>
Rust is like pair programming with a severely austic programmer, let's call him "Barry" the borrow checker, that insists you only program following his made up rules about safety.

Can't simultaneously change a variable and then print it because the printing function wants an immutable reference and you have a mutable reference and there's just no way to explain to Barry that this is ok.

Making data structures that involve pointer cycles is nigh impossible because Barry can't understand the "lifetime" of the objects involved.
>>
>>59215134
Of course it won't, because it is an assignment operator. It's going to be evaluated before it is passed to printf().
>>
>>59215156
Really makes you think huh
$ cat test.c
#include <stdio.h>

int main()
{
int i = 0;
printf("%d %d %d\n", i, --i, --i);

return 0;
}

user0@primary:/tmp$ cc test.c && ./a.out
-2 -2 -2
>>
>>59215168
>Making data structures that involve pointer cycles is nigh impossible

Use weak references
>>
File: 1487822049152.png (231KB, 342x342px) Image search: [Google]
1487822049152.png
231KB, 342x342px
>>59215198
Pardon me

This is how shit C is:
#include <stdio.h>

int main()
{
int i = 3;
printf("%d %d %d GO!!!\n", i, --i, --i);
return 0;
}

1 1 1 GO!!!
>>
>>59215198
My program is giving me "15, 14" just fine.
What's going on?
>>
>>59215236
Not me see >>59215233
>>
>>59215237
Still, why I'm getting the "expected" results but not OP? Is it because of different compilers or something?
>>
>>59214945
>AAA
Literally just means a big marketing budget, /v/igger cattle.
>>
>>59213307
Aren't mods supposed to ban spam? Lets ban that first.
>>
>>59215236
You are using compiler with different defined behaviour than C
>>
>>59215236
Could be that you're using a different compiler. This operation is undefined behavior as far as I recall.
>>
File: 1486275222031.png (139KB, 228x260px) Image search: [Google]
1486275222031.png
139KB, 228x260px
>>59215233
Mean while in a real language
$ cat test.d && dmd test.d && ./test
import std.stdio;
void main(){
int i = 3;
writeln(i, " ", --i, " ", --i, " GO!!!!");
}
3 2 1 GO!!!!
>>
>>59215256
>>59215259
I'm using Clang.
Can't test it with GCC right now or I'd be sure.
>>
>>59215216
great! now everything is reference counted! I'm glad I ditched a garbage collected language just to reintroduce garbage collection only shittier.
>>
File: 1480333122975.jpg (103KB, 964x964px) Image search: [Google]
1480333122975.jpg
103KB, 964x964px
>>59215270
>language so shit result varies within compilers
>muh ISO standard
>>
>>59215097
so edgy rajeet
>>
>>59215273
>everything

You're equating using a weak reference to break a cycle to full GC. I hope you understand how retarded that sounded.

If you have cyclical data structures and the memory wasn't allocated upfront rather than spraying shit all over the heap you're going to have reference counting anyhow if you're not chasing pointers to deallocate everything. If your use case is really that special and hasn't already been implemented in the standard library containers then just use raw pointers; they're in the language and Rust isn't as absolutist as you're pretending.
>>
>>59213307
But this isn't even UB. C works exactly how it said it would
>>
>>59214615
But do you know what a call is, though?
>>
>>59215269
>>59215233
I got a question


How will C tards ever recover?
>>
>>59215526
From what, expected behaviour?
>>
>>59213343
How would rust not be vulnerable to that? Does it use magic instead of integers?
>>
>>59215600
Presumably there would not be a buffer overflow error with grub_memset.
>>
>>59213307
Your flawed assumption is that /g/ C hardcore hacker geniuses would ever make a mistake.
>>
>>59213307
>write code that depends on the order of evaluation of the arguments in a function call in a language in which it is unspecified
>"my shitty code not working is the language's fault"
>use it to criticize C and shill Rust, when it is unspecified in Rust too
>>
File: file.png (25KB, 732x177px) Image search: [Google]
file.png
25KB, 732x177px
>>59213949
>care to post a screenshot? Java has this properly defined.
>care to post a screenshot?
You do realize that a screenshot proves nothing in this case, right? Even if it does work with a given compiler implementation, it may be undefined in the language specification itself, meaning you just got lucky, and your code may not work with a future implementation of the same compiler, or a different compiler. Anyway, I looked it up, and apparently the order of evaluation of function arguments is defined as left-to-right in C#, so >>59213937 was wrong.
>>
>>59215738
>it is unspecified in Rust too
lad
>>
>>59215794
That's C# 4.0
>>
>>59215596
>excepted behavior is "not working"
kek
>>
>>59215526
By making my projects in C because apparently programmers using rust can't even read/understand language specs.
>>
>>59214910
Which is a good thing, but can still be disabled.

Stay rectally shattered.
>>
>>59213307
C runs on literally everything though.
>>
>>59215250
Probably because you're not using the same architecture/OS. System V ABI pushes arguments from right to left on the stack, so it's quite natural to expect actuals to be processed this way. From a low level point of view this makes perfect sense. What's retarded though is to perform side effects in a function call when the compiler will transform it into SSA anyways.
>>
>>59216358
I have different results with Clang and gcc too. Both are caught as warning at compile time. OP is a faggot and nothing is new.
>>
ITT casuals. Rust is already dead and will never go anywhere, btw.
>B-But muh meme language of the week
Literally no one cares, and no one will remember.
>>
Also, making projects in C actually drives Rust shills (who are insufferable cunts in top of being politicians in disguise) away from my project. And all is good in the world.
>>
File: Redox_OS.png (1MB, 1024x768px) Image search: [Google]
Redox_OS.png
1MB, 1024x768px
>>59216479
Whatever helps you sleep at night, C-tard.
>>
>>59213427
If you use your brain for a second, you'll realize that the language on the bottom is D.
>>
>>59213307
>Rust makes it harder to produce programs

Fix'd
>>
>>59217574
>implying I get anything worse than a C
Enjoy your failing grade, scrub.
>>
>>59216684
>userbase count: 1
>>
>>59220721
Just like Linux 25 years ago.
>>
>>59221130
seconds*
>>
>>59218274
For a C toddler
>>
C.ucks TORN TO SHREDS
>>
>>59217574
A C babby is too newb to understand this
>>
>>59213307
C is plain and simple. Rust makes it harder to produce as it implements dangling pointer prevention, data race prevention, lifetimes etc. This is against the interest of people and programs.

Fixed
>>
>>59221294
Hi, NSA.
>>
L0rd_S3xXh4xoRz my son, it is time for you to start developing a new program that will be critical to your security.
Will you chose beautiful modern language with safety guarantees whose developers built to correct the mistakes of the past
Or will you chose old C and all its quirks that require 30 years of experience in the language to avoid
>>
>>59221379
Kek I'll make this one
>>
>>59221294
t. nsa
>>
>>59213307
You raise a valid point. Too bad C toddlers are too deep in denial.

Meanwhile I'll be waiting for the newest crippling exploit in Linux because Linus is a C purist. I swear if FreeBSD or OpenBSD start working on porting their kernel to Rust I'll jump the wagon straight away.

I care about my privacy
>>
>>59214849
No, OP opened google translate to ask a Chinaman for a hotdog, and didn't realize he actually asked for a hamburger, because as it turns out OP doesn't actually know Chinese and has confused being able to utter sounds in Chinese with being fluent in the language.

Even if OP happened to know all 50,000 or so Chinese "words" and all their tonal variations, he's ignoring all rules of Chinese syntax and grammar and is just speaking English while making noises that happen to sound like Chinese.

Despite the fact that the error is his and that he cannot effectively communicate with a native Chinese speaker, OP is suffering from the delusion that, obviously, the problem is something else entirely.
>>
>>59221563
Linus never cared about security and so he is going to keep using exploit prone C(rap) language. If anyone gives a shit it's going to be Theo.

I hope OpenBSD adopts rust soon.
>>
>>59213307
>data race protection
Thank (((god))) finally a language I can get behind.
>>
>>59213307
Yea if you pay enough they will rewrite shit in Rust.
Goodluck all the open source software written already isn't going to change unless someone pays devs lots of money to rewrite and introduce new possible bugs.
>>
>>59221636
wtf I hate Linus now
>>
>>59213307
Holy shit you fucking nigger tard. You're decrementing n before the statement is executed, therefore it will always be 14 when that statement is run. You. Need. To. End. Yourself.
>>
>>59221880
>You're decrementing n before the statement is executed
no I'm not

#include <stdio.h>

int main()
{
int i = 3;
printf("%d %d %d GO!!!\n", i, --i, --i);
return 0;
}

1 1 1 GO!!!

or

import std.stdio;
void main(){
int i = 3;
writeln(i, " ", --i, " ", --i, " GO!!!!");
}
3 2 1 GO!!!!


Which one works?
>>
>>59221916
The bottom one. I'm guessing that's not C because that's actually working lelelel
>>
>>59221880
You fucking retarded C toddler. GCC and Clang produces different results. Clang works as expected. So where does your argument stand, C babby?

rekt and burried
>>
>>59221990
LOOOOOL HOW WILL C TODDLERS EVEN RECOVER
>>
>>59214065
>You're altering a piece of memory while using it somewhere else and expecting it to be isolated.
If that's so dumb, then why does 'x++' return a value?
>>
>>59221990
>As expected
Have you read the C standard?
This is embarrassing
>>
>>59222040
They can't, they'll be eternally ass flustered
>>
This is literally expected behaviour.
Abstracted example:
someFunction(n, --n);
To call someFunction all of the parameters must be evaluated. First one is a simple number, so nothing to do here, but second is actualy described like
int predecrement(int in)
{
in = in - 1
return in
}
So you run predecrement and now all of the parameters are evaluated. So someFunc is called with parameters n and return value of predecrement(n).
If it gave tou two different numbers that's really fucking wrong as that would imply that you are creating a copy of n before decrement. This makes the order of parameters passed matter and more importantly if n was a fuckhuge struct you could run out of memory on embedded or just slow program down with huge allocations and deallocations. OR even worse n could be a struct that locks an unique object causing a ton of UB
>>
>>59222108
>If it gave tou two different numbers
Retarded C babby. Do you understand how function can mutate it's arguments?
>>
>>59221990
That means its a bug in clang
>>
>>59222129
Only if the function doesnt take a value
>>
>>59222173
what are you on about?
>>
>>59222183
I dunno, what are you on about? Function can only change its arguments if they are passed by ref or a pointer, otherwise it works on copies, but how is that even related to given example?
>>
>>59222255
>how is that even related to given example?
see >>59221916(the bottom one, one that is working as expected)


First time i goes through unary decrement prefx, i gets reduced from 3 to 2. So second time instead of 3, i=2 goes through the same operation. It's not rocket science.
>>
>>59213307
So we are mad because on the top the program executes as expected and on the bottom the program doesn't?

You're telling C to decrement n before print and it does exactly what you tell it to.

On the bottom, --n for whatever reason either doesn't obey the paradigm or writeln is actually writing multiple separate lines with function calls in between instead of writing a single line in one shot like C does on top.

Either way the comparison is worthless.
>>
>>59222361
>top the program executes as expected and on the bottom the program doesn't?
actually the top one doesn't work as expected and the bottom on does

see >>59221916

And no, Read the OP too
>>
>>59222320
It isnt though. All of the arguments of a function must be evaulated before a function call. Otherwise you are creating non-explicit copies of an object which is bad. How ypu read it doesn't matter
>>
>>59222388
Yes, i was called before --i, the first --i was called before the third --i.
>>
>>59222381
>>59222320
The top one 100% works because it obeys the C standard and nobody cares about your feelings on the issue. Go ahead and fork gcc with changed standard and encounter numerous problems. I don't know D's standard but it could be valid too
>>
>>59222461
>The top one 100% works because it obeys the C standard
>standard of shit not working as it should and does in every single other languages out there including She++ itself
>Muh ISO standard exists to see this much inconsistency between GCC and Clang
>>
>>59222361
It's actually undefined behaviour in C and the compiler is allowed to do whatever the fuck it wants to.
So even if it printed -5 and -199 it would still be expected.
>>
>>59222514
Truly C experience
>>
>>59222409
It was WRITTEN before.
Doesnt matter tho. C doesn't specify argument evaluation order so it there are 3 combinations it could run. What it does specify is that all free shall be evaluated before the function is called. And after they are they all point to the same adress in memory and thus are the same
>>
>>59222543
>C doesn't specify argument evaluation order
All other languages do
>>
>>59222527
> Doesn't know the standard
> Just asumes things
> Thinks he should be taken serious

Next you will complain that arrays are indexed from 0.

>>59222543
They aren't even pointers. --n is an expression with a side effect, which is slightly different to
 n = n -1; 

The "correct" thing would be a bitt different, but the standard just declares it UB so everything is correct.
>>
>>59222577
OCaml doesn't specify argument evaluation order
and in the past it changed.
>>
>>59222508
>standard of shit not working
opinion
>as it should
opinion
>and does in every single other languages out there including She++ itself
every single other language has a different specification
>Muh ISO standard exists to see this much inconsistency between GCC and Clang
There is no solution for human errors. No standard or language can make a good programmer. Somebody just made a logic mistake in clang
>>
>>59222607
welcome to C(rippled) Standards Committee where

-we will read your function from top to bottom
-we know how unary prefix and postfix works
-we just won't evaluate functions from left to right :^^)

-you are welcome
>>
>>59222577
Yes, and?
>>
>>59222686
C is trash
>>
>>59222686
C is cancer that lives under a rock
>>
C is Communism
>>
>ITT: Brainlets who don't understand function calls
Enjoy your walled garden and 1000 layers of abstraction.
>>
File: 1488248151444.jpg (233KB, 503x662px) Image search: [Google]
1488248151444.jpg
233KB, 503x662px
>>59221916
>>
>>59222701
>>59222690
opinion, doing things different is not bad. Especially if the only reason you think it's bad is because you don't understand, even is resources to learn are easily avaiable

>>59222713
C is for cookie
>>
>>59222774
>look mom I eat cornflakes with forks because i'm different amirite
>>
>>59222774
C is Crap
C is Cancer
C is Crime
>>
>>59222721
>how many layers of abstraction are you on
>like,, maybe 5, or 6 right now. my dude
>you are like a little baby
>watch this
>std::
>>
>>59222774
C is for Cock Craving Cuck
>>
>>59222788
>>59222801
Not an argument. I like how none of you noticed my point how copying same object in different states can lead to problems.
>>
>>59222655
Welcome to the real world where sideeffects in expressions are a bad thing.
Also there's no sequence point in a function call (sequence points are usually blocks or the sequence operator ';') so this is expected.
Which anybody that has at least half a brain could infer.

It's not the best standard, but asuming sequence without a sequence point is just mind boggling stupid
>>
>>59222837
side effects in expressions are actually required for small functions like 3 2 1 GO example
>>
>>59222854
So?
That sure looks like something that couldn't be done any other way and actually is common in real world code.
>>
Little fucking Rust SJW shits on this board need to leave.

You will never have power over C with your shitty meme language. C will always have a place whereas Rust will die out within a couple of years.
>>
none of this shit matters your sytems are all cucked at the hardware level now
>>
>>59223001
Fuck off NSA
>>
>>59223000
Real world C programs are full of preventable security exploits
>>
>>59222813
>17
C is for Cucks
>>
>>59223121
Real world Rust programs don't exist :)
>>
>>59223121
*if you're a retard and don't follow proper practice
>>
>>59223141
>If you make bugs you are retard
Classic NSA shamming. Now get out.
>>
>>59223138
For now
>>
>>59223121
Nothing prevents Rust program from having the same sort of bugs and if you think otherwise you are retarded.
>muh compile/runtime sanity check
Refer to my previous sentence.
>>
>63 NSA shills defending C so they can keep exploiting programs out in the wild
really makes you think
>>
People who call for C to be banned are incompetent retards who need the computer to hold their hand at all times.
>>
>>59221916
lol wtf

#include <stdio.h>
int main()
{
int i = 3;
printf("%d %d %d GO!!!\n", i, i--, i--);
return 0;
}

1 2 3 GO!!!
>>
>>59223121
Fun thing, your hardware is buggy enough that any programm will be a security liabilty because the static checks don't apply to what's actually executed.
>>
>>59223193
Dangling pointers:
uint8_t* get_dangling_pointer(void) {
uint8_t array[4] = {0};
return &array[0];
}

// Returns a dangling pointer to a previously stack allocated memory

Rust’s lifetime checks apply to more than just locally defined variables. They also apply to returned values.

In contrast to C, when returning a reference, the Rust compiler makes sure that it will remain valid when it finally reaches the caller. i.e., the compiler verifies that the returned reference will live long enough. Thus, it can be said that Rust references ALWAYS point to valid memory.
fn get_dangling_pointer() -> &u8 {
let array = [0; 4];
&array[0]
}

// main.rs:1:30: 1:33 error: missing lifetime specifier [E0106]
// main.rs:1 fn get_dangling_pointer() -> &u8 {
//
>>
>>59223205
>
It's just that people that made silly mistakes (like Linus) is not as (((expert))) C kernel haxxor such as yourself, anon.
>>
>>59223227
>should've printed 3 3 2, but your point still stands
>>
>>59223251
>implying C is the only language one can make mistakes in
>>
>>59223205
Teach me your ways, turbo C hacker master
>>
>>59223238
So? It's still caught by C compilers as a warning.
>>
>>59223306
HEARBLEED bug:
void print_out_of_bounds(void) {
uint8_t array[4] = {0};
printf("%u\r\n", array[4]);
}

// prints memory that's outside `array` (on the stack)


In this case, Rust makes use of run-time checks to mitigate this unwanted behavior. I must admit, this non-glamorous feature put a smile on my face the first time I stumbled upon it.

Here’s the same example in Rust -
fn print_panics() {
let array = [0; 4];
println!("{}", array[4]);
}

// thread '<main>' panicked at 'index out of bounds: the len is 4 but the index is 4', main.rs:3
>>
>>59223330
HEARTBLEED*
:^)
>>
>NSA C NSA C NSA C NSA C
ITT Rust is a go-to language for schizophrenic OPs with delusions of persecution.

>>59214945
I thought C was revealed to mankind in 1911 by Jesus H. Christ and John Moses Browning.
>>
File: mystery.jpg (160KB, 1426x650px) Image search: [Google]
mystery.jpg
160KB, 1426x650px
This prints the lyrics to 12 Days of Christmas.
>>
>>59223440
What did NSA mean by this
>>
File: w1p86tkggv1.png (81KB, 512x288px) Image search: [Google]
w1p86tkggv1.png
81KB, 512x288px
>>59213307
Because in C we don't pay for what we don't use and can deploy to every target we want to.
>>
>>59223725
>implying C has a significant amount of unrequired features
>>
>>59223725
>already topped up C++
I'm glad Rust is catching up
>>
>>59223768
Yeah I was pretty surprised too when I posted it.
At the very moment Rust catches up with C we'll start switching.

>>59223758
More features means nothing.
If we ranked a language for its features C# would be the first rather than frankenstein.
>>
>>59213307
>suggesting Rust as the replacement for C
Absolutely Degenerate.
FORTRAN or GTFO
>>
Rust won't take over C's place, because C doesn't need any improvement. It is designed for lower level programming close to the machine. Sometimes even C is too high level, and you need to add inline ASM instructions. C is perfect for the tasks where it is needed, it doesn't require more level of abstractions and safety checks...
>>
>>59224019
Does Fortran have safety checks?
>>
>>59213331
C++ is a direct upgrade to C but comes with its own downsides, not least of which is its convolution of different features, and it's nigh incapability to be parseable. It also keeps some of C's largest flaws.
>>
File: wut.png (63KB, 1162x596px) Image search: [Google]
wut.png
63KB, 1162x596px
I have seriously no fcking idea what all this shitposting is about
>>
>>59224050
Typical cinbred, everybody!
>>
>>59224780
Your very post is it. Your output is completely nondeterministc based on the OS, compiler, memory contents, and hardware used.
>>
>>59213307
>Rust
fuck rust, use ada
>>
>>59224848
It clearly warns you about it.
>>
>>59225150
Ada is literally a shitty version of rust.
>>
>>59225231
Nice ignorance, my dude.
>>
>>59225231
It's quite the other way around actually.

Call us when Rust is certified for use in fighter jets and nuclear weapons systems and stuff like Ada is.
>>
>>59225382
>this is how retarded adatards are
>>
>>59225597
Nice rebuttal.
>>
>>59225794
What can you expect from someone in highschool?
>>
>>59225794
not an argument
Thread posts: 322
Thread images: 18


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.