This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Uninitialized Memory Read In Packed Enum
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Lu, Alexandra (Alexandra)" <alexandra dot lu at alcatel-lucent dot com>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Sun, 20 Oct 2013 12:42:34 +0200
- Subject: Re: Uninitialized Memory Read In Packed Enum
- Authentication-results: sourceware.org; auth=none
- References: <D110211CE0572F469820CE68E84D2140614BD1AA at US70UWXCHMBA03 dot zam dot alcatel-lucent dot com>
On 10/19/2013 04:19 PM, Lu, Alexandra (Alexandra) wrote:
When I use the "__attribute__ packed" option to compact enum from 4 bytes to 1 byte, it works well for saving memory when placed with other 1 byte data. However, when this packed enum is used to instantiate say a local variable, our memory tool (Purify) will complain that 3 out of the 4 bytes are uninitialized, causing a lot of UMR errors. Is there any way to work around this problem to keep the memory tool happy?
I think you need to ask the Purify folks. I suspect they interpret
packed enums differently from GCC, which might be a bug in their tool.
--
Florian Weimer / Red Hat Product Security Team