Yet another security issue due to C's lack of type-safety. C doesn't have sumtypes unless you implement yourself with unions (even if you do, you have to make everyone else to agree to use your implementation of sumtypes which is not possible), C++'s std::optional and Rusts Option is a more type-safe alternative to traditional sentinel value. D has Nullable!T that does the same thing too.
There's no reason for polkit to be written in C while superior languages like C++, Rust and D exist. C is old, obsolete and not even self hosted these days.
Protip: there are still assembly developers out there that are paid upwards of a quarter million for their expertise
Gavin Miller
doing what?
William Baker
>he thinks software that isn't baby proofed for his stubby diabetic hands makes it "obsolete" Please throw yourself into a fire.
Gabriel Butler
C is not a software, niggy
Gavin Thompson
Not that guy, but software is anything that isn't hardware. Yes, that includes languages, otherwise what the fuck is a compiler?
Owen Martin
Language, whatever. You're still a moron who thinks it's a good idea to baby proof things because you are literally incapable of doing things correctly in the first place.
>doesn't know what he's talking about >y-YOuRe sTiLl a mOrOn lol get the fuck out of my thread, faggot
Anthony Williams
The bug is fucking hilarious. There is an assert checking if the input is valid. The assert triggers but freedesktop retardheads let it to execute with invalid parameters anyway.
Lincoln Adams
Uhhh, writing assembly?
Nathan Long
Jow Forumskit BTFO
Parker Richardson
>t. I'm too retarded to program please put in safety guards so I feel better
Kevin Wright
oooh, you must be one fuckin badass nerd for not needing any type-safety lmao
Evan Peterson
how long until a decent OS is written in rust?
am I wasting my time fucking around with C? I spent years on high level languages like ruby, clojure, erlang etc but recently have wanted to learn more about linux's internals and bootloaders and all that shit.
Should I just skip to rust? I know the fundamentals of C but I'm trying to actually get up to speed on idioms, the whole ecosystem and build tools etc.
Nathaniel Edwards
you want training wheels, got it.
Luis Murphy
...
Leo Gomez
>am I wasting my time fucking around with C? Yes. Move to C++.
Colton Allen
doesn't C++ have all the same issues?
Brayden James
No, I'm just smart enough not to make retarded mistakes because I actually understand what shit compiles to, instead of just spamming compile like a literal code monkey.
Lucas Walker
Modern C++ is actually better. Just avoid using legacy pointers and C libraries. Use STL, unique_ptr, shared_ptr etc and you are fine.
The only bad thing about C++ is that it sucks major balls in parsing or working with uni-codes and ranges.
Joseph Bailey
So what am I supposed to use to write embedded firmware and other low level shit?
Brandon Morris
>having to type unique_ptr instead of * absolutely disgusting
Joseph Young
>because I actually understand what shit compiles to What would this result to? int x; int y; x = 4; y = 10; puts(++x + y - --x + y - !y * x++ + ++y*--y );
Austin King
C++
Carson Thompson
Those two are different things
Levi Rogers
Shit like this is why I will never use Rust.
Anthony Cruz
>*cricket noises*
Wyatt Sanchez
Why would you even try to compile code with UB
Oliver Cox
So you don't know what your code compiles to?
Hunter Jones
I was going to disagree with you on that argument, then I realized OP is literally saying C is too simple and therefore obsolete. Yeah, simple things aren't going away any time soon. C, however, certainly isn't the optimal.
Ayden Myers
>pedantry Fuck the big J, but I agree with you, C++ can't be called "superior" to C. It's a different language.
Isaiah Bennett
It's undefined behaviour, you fucking retard. The compiler is free to output whatever the fuck it wants in the case of undefined behaviour.
Gabriel Lee
all this shit prodused by people who cannot code buy love to learn something, but anyway cannot code
>It's undefined behaviour, Just like 90% C codebase
Alexander Robinson
The point here is that C is for lower level things. No one, not even (you) can really grok how the compiler works in everyday usage. It's too complex, from hardware to language extensions, to use effectively. For this reason, higher level languages are useful and should be used for everyday tasks so we don't make a giant heap of garbage all the time. However, C will never be replaced by these because more complex "safe" languages can't take its place.
Nathaniel Harris
same like wide spred of sexual deviations of people who cannot jist f-ck a girl
Just because you samefag like a literal autist, doesn't mean everyone else is too. Also like a dumbfuck, you thought you were printing the summation of those values to output when you really are outputting the address of some random as fuck memory address, which will (in all likelihood) result in an exception occurring. However, I will operate on the false assumption that puts actually sends a string value to output instead for the sake of argument. Even when doing that though, you should note that your still outputting garbage. pastebin.com/YywvunQN
Gavin Parker
>No one, not even (you) can really grok how the compiler works in everyday usage Well yes, I can, because I've written my own basic one; as well as produce macros to be used with an assembler for outputing various Windows and Linux image file formats.
Michael Turner
>RAII i nned control initialisation and make it in propper time cose it take time and anoing user
Sebastian Price
>string switches >more knowledge than comparing C strings
Jose Edwards
That's a long way of spelling "No".
Lucas Green
That's literally the assembly equivalent of your retarded as fuck broken and janky C++ code, you faggot.
Jordan Evans
No, not really, it isn't. Read the code again.
Thomas Hernandez
Nope still no reason to use Rust. Just another good reason to not use systemd.
Jayden Gray
> Kernel vulnerability breaks out another day that could easily be prevented with compile time type-safety > Nope no reason to use better languages, just don't use Linux
Michael Kelly
What kind of faggot uses polkit? And this has nothing to do with C being obsolete, it's some retard's fault.
Christian Gonzalez
web dev
James Perez
C has compile time type-safety. Rust is trash, and only for people who need training wheels.
Connor Sanchez
C is a weak typed language and has little to no type safety. C is used by peanut brain boomers that are too retard for types and ultimately see their projects crumble down from easily preventable errors. Like this one for example
Ethan Bailey
It's cheap and deterministic
Kayden Russell
>Weak typed It's ok to be afraid of pointers, just not everyone is. You have to understand that when you come crying to strangers on the internet. >type safety Types need to match, I don't think you know what this is.
This bug is easy to prevent by sanitizing external input, as you always should. I'm ok with you using Rust, you sound insecure enough in your abilities that I would be uncomfortable with you being anywhere near pid 0. Then again I could say the same thing about my goldfish.
Asher Stewart
>HURR JUST BE SMARTER You cniles never learn.
Liam Ramirez
smard program do 1. memory allocation 2. all annitialisations 3. say to user "am ready" RAII is f-cking shit, you dump nigger
Angel Gutierrez
Template syntax is elegant compared to function pointer syntax in C.
Jack Allen
You claim to be a C expert yet apparently you've never been handling numbers in C.
Parker Carter
Smard program that know allocation ahead of time use placement new or static allocation.
Smard program that need new runtime objects use a object pool (like boost pool).
Smard program have no-leaks and not cluttered with goto fail/cleanup
David Price
STRINGS, VECTORS, STL, BOOST all this shit slow as f-ck INSTEAD OF USING NAMSPASES CREATE MUH OBJECTS then use em for creating memory leaks everevere
Alexander Collins
>Smard program that know allocation ahead of time use placement new or static allocation. QUAKE alocate 32mb at start >Smard program that need new runtime objects use a object pool (like boost pool). all "object" live in this 32mb >Smard program have no-leaks and not cluttered with goto fail/cleanup when QUAKE done 32mb deallokated
Julian Clark
Rust and go are arguably better for most applications, but who wants to fund rewriting all of that code in a new language?
Jordan Lewis
C++ do exactly this too with placement new and custom memory allocation. Also all program 1990's video game engine for specific video game with predictable memory usage.
Chrome from now on allocate 32gb at startup and free at close for "C" style simplicity.
Lincoln Cooper
Also memory management 99% of all codebase.
Nathan Murphy
>32gb 32mb and 32gb, feel the difference
Jose Reyes
32gb due to C++ bloat. Chrome memory usage from binary size. Maybe you be smart grug and make QUAKE engine render html and interpret javascript in 32mb.
Hunter Perez
STRINGS, VECTORS, STL, BOOST all this shit slow as f-ck INSTEAD OF USING NAMSPASES CREATE MUH OBJECTS then use em for creating memory leaks everevere
Elijah Baker
You're welcome to program embedded systems using anything but C or ASM.
Lincoln Edwards
We have at least two of these a day. Some retarded c++ programmer or jealous rust programmer or functional weeabo saying that C is bad. C is obsolete. Fuck C. C++ better than C, etc. etc. C came out in 1972, thats right nigger. It's 46 years older than you. If you are using a language that is younger than you you better be at least 47 years old, or you have to take into account this large span of time C has reigned king in embedded and OS while its compilers grew stronger.
Hudson Carter
is that supposed to be a gotcha?
Julian Evans
just use BASIC if (You) retarded for C and ASM at least BASIC is memory effective
Jackson Ward
where? literally nowhere to use BASIC these days. Can I use it to program games? Wheres OpenGL for Basic
The rust language itself offers nothing new and is poorly implemented. So what's left besides marketing wank and the community full of shills who harass everyone.
Xavier Wilson
Why is polkit a thing in the first place? Fuck red hat and their shitware.
Cameron Mitchell
C++ works fine.
Logan Perry
i would just limit uids to 32bit and not give a fuck about it. who the fucks need more than 4 billion users in a system? this is not webapp
Aaron Nelson
shitposting on Jow Forums
Levi Brown
STRINGS, VECTORS, STL, BOOST all this shit slow as f-ck INSTEAD OF USING NAMSPASES CREATE MUH OBJECTS then use em for creating memory leaks everevere
Adam Kelly
Vectors are very fast, what are you talking about, if you need a variable length array you wouldn't write a faster one of you tried. There's also std::array, exactly what it says on the tin. Other STL algorithms are quite fast as well. C++ strings suck balls though, not gonna lie.
not all this shit upredictable and slow and make memory leaks everevere
Oliver Roberts
it have speed same like BASIC strings
Xavier Flores
is that slow? a string is just an array it doesnt have a very subjective implementation
Luis Harris
yes, strings and vectors are slow
Daniel Johnson
in comparison to what? do you have a faster dynamic array implementation?
Isaac Sullivan
>a string is just an array magicaly allocated in maguc memory of miracle land of magic
Jaxson Lewis
>Protip: there are still assembly developers out there that are paid upwards of a quarter million for their expertise Correct. I used to do assembly programming for a living.
Often embedded stuff, including DSP. Crazed compiler writers fail to realise a skilled assembly programmer writes way faster and far more compact code than compilers can.
David Phillips
>do you have a faster dynamic array implementation? yes, it static array
Tyler Fisher
>magicaly allocated in maguc memory of miracle land of magic the definition of a string doesnt say anything about memory allocation
Tyler Brooks
not the same thing
Ian Perry
Ranjesh pls.
Jose Perry
so it allocated in magic memory of miracle land of magic
Lincoln Clark
where your string is allocated can be completely predictable or left to a memory allocator
John Morris
ho many memory allocators (You) writed in (You)r live?
Adrian Clark
too many to count
Angel Cooper
liar
Oliver Bennett
the difficulty of writing a memory manager discourages the use of strings
Carter Taylor
Don't ask a question if you can't handle the answer It's a common task if you're writing game engines