From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: Dennis Ritchie To: 9fans@cse.psu.edu Subject: Re: [9fans] how to avoid a memset() optimization MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 13 Nov 2002 21:48:20 -0500 Topicbox-Message-UUID: 1e3337d0-eacb-11e9-9e20-41e7f4b1d025 Minnich remarked > I feel the need. Linuxbios no longer works on gcc 3.2 because of some > bizarre optimisations that have gone in that break mptable parsing. One > person claims that you can no longer count on this: > struct x { > int a; > int b; > }; > resulting in code in which a and b are laid out in memory in the same > order as in the structure (this due to C++). Structure members can get > reordered. > I can't believe this is true, but someone claims it is and I have not had > time to verify it. Dunno about C++, but C99 still specifies that structure members are laid out in the order they are declared. Dennis