Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ddephor45117yOh, come on, do you really miss your mistake on that one line of code?
Ok then:
You omitted a return value on a function returning an int. That results in undefined behaviour. In your case it leaves 0x8B as result for the environment starting your program.
Next time it may be some other value. It may even be 0, so it might look ok, but the code would still be wrong. -
@ddephor Yeah, no. Main is a special function in both c and c++ where the return value is optional.
The issue was in a different area of the project. Even though I deleted all of the #include statements, that code was still built, and gave a segfault.
I took a minute to realize this myself, and was very fucking angry for a while! Debugging nightmare! -
@AlgoRythm the return value is not optional, however would definitely not cause this
-
@AlgoRythm you should write it in. Yea you can omit it and nothing will blow up, but that's a bad habit to get into
-
kiki353257y@AlgoRythm afaik return value is optional in MSVC compiler. But in GCC that's required
-
tetris1677y@finncyr You can't just say it's shit. It is probably the best open source C/C++/Fortran IDE. Though it lacks a lot of features (e.g. alt + click = go to definition), it is one of the fastest tools for writing and testing your functions.
-
@finncyr @milleringer That's like saying Notepad++ is shit. It's basic and old but you still know damn well it's one of the best editors out there. I just prefer something more fancy, like sublime.
-
tetris1677y@AlgoRythm I just wanted to say that no one has the right to say anything is shit without previously giving at least one good argument. Why would anyone be expressing him/herself like that? Not worth those precious zeros that had to be rewritten on the server :)
-
@milleringer Well, simply, because people are allowed to have opinions, no matter how uninformed or how much you disagree with them.
-
@milleringer And, to be clear, in the United States at least, everyone has that right.
-
antic16387ySometimes the build system gets confused about a timestamp on some source file and doesn't recognize that it needs to recompile it. It's become standard practice that if something like happens to just delete all the object files.
Also, #includes are evil. Someday we won't need them anymore 😁
OKAY WHAT THE FUCK
rant