Honest question as my C++20782381238 is rusty: what exactly is the problem here and what should the compiler warning be?
Is it the order of initialization that bugs you, or what?
General C++ rant: I'm frustrated with the tons of new features constantly pouring in since C++11. [s]Wow, we have std::filesystem stuff now! Cool, 20 fucking years too late but still. But if they focused on the practical stuff like this first and foremost, we wouldn't have kick-ass stuff like std::string_view and folding expressions, which we totally needed. How's the concepts coming up?[/s]
Christian Allen
Want something else that compilers don't warn about? Casting a const char* to a char*.
the point here is not doing this shit on purpose but the fact that if you have a large projectr the problem in the OP can easily happen a compiler warning at this point would be nice to reduce years of looking through code to find the problem
Carson Anderson
wow so hard. go suck some bbc you faggot
Joseph Gomez
which tool warns about the issue at hand? feel free to back up your claims anytime
Jacob King
Rust XDDDD
Jacob Carter
What is it about cocks that entices you so much, OP?
Levi Martinez
wait, do you even know what the problem is or are you just larping?
Elijah Robinson
The problem is that you wrote incorrect code and then whine that your shit is fucked. Write correct code next time.
Benjamin Wright
so you don't know the problem...
James Sanchez
The problem is that you are basically retarded and expect the compiler to do the work for you. Write correct code next time or use Javascript
Levi Adams
...
Owen Murphy
I'm actually just pretending to be retarded. I mean what do you expect trying to tell Zig Forums that C/C++ isn't perfect?
Austin Edwards
Come on now, the OP is clearly a faggot that writes bad code because he can't see the computer screen with all that /cuteboy/ cum in his eyes, but you're being evasive.
Owen Bell
C is perfect, C++ is an abomination.
Kayden Wilson
Found the LARPer
Nolan Scott
I'm on my phone so I can't compile, but I see the issue, it's that you're using the obj before it is created. Well, that will crash, you look into the debugger and discover that the argument passed is 0. Not hard to figure out at all. Shit like this would be caught by clang format probably anyway. OPdoesn't have any arguments. If it's just you and fairly small program, this is unrxcusable, if it's big corpo project, there's constant code reviews, unit tests, starical analysis, people are all about "clean code" by that faggot uncle bob. This would never pass unless the code is outsourced to pajeets or something.
William Walker
btw OP, did you report it to the gcc team or to some other compiler people ? I doubt it.
Charles Stewart
kek
Benjamin Price
It's because you passed -pedantic when you clearly meant -autistic.
No, the punctuation in that image uses rectangular shapes. Ubuntu Mono uses round shapes.
Christian Peterson
get cucked, fuck.
Michael Walker
It's not Ubuntu Mono. Fontsquirrel doesn't seem to recognize it either.
Juan Ortiz
what shit compiler do you use that doesn't give a warning for this?
Gabriel James
What's the problem with C?
Evan Sanders
Did he step off the Mayflower yesterday?
Joseph Long
Trying to learn C++ here, is the problem that in struct Foo obj is called with obj{obj} but inside struct Object there is no correlating match? What's the problem here?
Benjamin Nelson
No Rust? Into the trash.
Isaac Baker
Thread is shit if OP doesn't explain why a compiler should generate a warning for this code.
Because the compiler can't make sense of C++ either.
As DLW says, "C++ is the C of object oriented programming languages."
Subject: C++ Is Good For FertilizerThis message is in reply to a "discussion" spurred by the"observation" that (I quote roughly and from memory)"Computers are used by 50% of the people in the world, and Cis used by 50% of all programs, therefore improving C [ieincrementing it and discarding the result] will potentiallymake the world a 25% better place to live." I am not makingthis up.The original subject line for the discussion was "C++ isgood for the world."
It doesn't warn you, because it assumes you're smart enough to know that modifying data before it's even initialized is fucking retarded. int main(){ int x; ++x; x = 4; return x; //hurr why isn't it returning 5??? muh safety}
Ryder Adams
languages that force variables to be initialized before they're used won't let this happen does rust enforce this?
Robert Miller
if anyone else cares, it's mononoki
Wyatt Howard
...
Camden Barnes
yes???????????????????? even pajeet languages enforce this.