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
-
@CWins can be of any type so long as it's assigned, no optimisations enabled.
It's never referenced, used or changed anywhere. -
2xCmet1827yHad nearly the same Problem, if I delete one line where just the Parameter of one object is read and nothing is done with the value except printing it, it crashes. Kinda weird
-
CWins48117y@Jamoyjamie
I didn't ask if it is used by anything explicitly in your code, i asked if it changes ;-)
If that piece of reserved memory is important, what needs it to work?
C++ allows you to put your pointers and indices in positions that are not intended.
And what do you mean by assigned, did you try to fill true in every bit or does it only work with numbers like 0 and slightly above? -
@CWins Sorry!
The line is literally a local variable declaration at the top of a function:
float cf = 1.0f;
Didn't try a whole host of possible values but tried a few different floats and tried changing to a char and other types to see if data size mattered and it didn't.
The variable isn't ever explicitly referenced anywhere so I do expect it's a pointer that's started misbehaving.
I need to get a debugger on it tomorrow, not a big C++ person so still finding my way round tools etc.
I don't expect you to be able to help with such little information don't worry! 🙂
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
I have a local variable that is completely unused, can be of any name or type as long as it's assigned.
Yet, if I delete it the program no longer works.
Huh?
undefined
what
c++
opengl