# uninitialised variables

Hi all,

I’ve got some badly written sources with uninitialised variables. With my previous compiler, these uninitialised variables were sets to zero, which is not the case with pgf. This leads me to the two following questions :

• is there a way to force pgf to set to zero unintialised variable (fast but bad solution for sure :) )

• is there a way to analyse the sources during compilation or maybe with some other software for such uninitialised variables?

Will

Hi Will,

• is there a way to force pgf to set to zero unintialised variable (fast but bad solution for sure :) )

Yes! The fast (but bad) solution is to compile with “-Msave”. “-Msave” applies the SAVE attribute to all local variables and has the side effect of initializing all local varaibles to zero.

• is there a way to analyse the sources during compilation or maybe with some other software for such uninitialised variables?

I personally use Valgrind http://valgrind.org/ and have found it to be very good at detecting these types of errors.

• Mat