0 votes
ago by Bart Nelson (580 points)
In his paper to Euroforth 2025, Nick Nelson made a plea (I think his second plea on the same subject), that local values should be initialised on entry.
It is so easy to forget to do this manually.
Now it has caught us out again.

If you use

gtk_tree_model_get

to retrieve the value of a column, and you use a local to put it in, it works fine if the column is a data type string.
But if the column is a data type int or bool, and you tell it to put it in ADDR <local> , it only half fills it because ints and bools are only 32 bit.
If you have forgotten to manually initialise your local, then the result is garbage.
A very hard bug to track down.

Please log in or register to answer this question.

...