Re: uninitialized stack variables


Subject: Re: uninitialized stack variables
From: sam th (sam@bur-jud-118-039.rh.uchicago.edu)
Date: Thu May 11 2000 - 11:02:05 CDT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 11 May 2000, Mike Nordell wrote:

> Since I've run into a lot of troubles regarding unitinialized stack
> (auto) variables, do you know what _your_ compiler does with these in
> debug builds?
>
> Example:
> void foo()
> {
> unsigned char bar;
> ...
> // is bar initialized to something here (like zero)
> // or is it "almost random"?
> }
>
>
> The reason for this question is that I've added _a bunch_ of asserts for
> UT_Bool (that at the moment is typedef'd to unsigned char) to make sure
> that it's only UT_TRUE or UT_FALSE, but if your compiler does zero the
> stack these asserts will have no noticable effect for you.

Well, I get an upside question mark so I think random.
           
                                     sam th
                                     sam@uchicago.edu
                                http://sam.rh.uchicago.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE5GtmAt+kM0Mq9M/wRAt+qAJ4pVKmI8od3i88bDWHsa1Yj0N/ZEACeNbO/
YA8biEtAVvyvtBahe57XP5U=
=1pvo
-----END PGP SIGNATURE-----



This archive was generated by hypermail 2b25 : Thu May 11 2000 - 11:02:01 CDT