From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Andrew Cagney Cc: Stan Shebs , Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [PATCH] use memset to zero the fields of a new frame_info Date: Sun, 20 May 2001 13:06:00 -0000 Message-id: References: <3B042FD4.81EE2FC3@cygnus.com> <3B04330A.21E8784E@apple.com> <3B049F47.5040706@cygnus.com> X-SW-Source: 2001-05/msg00384.html Andrew Cagney writes: > When it comes down to it, I'm more concerned with ensuring that all > memory is initialized to a well defined, machine independant, value then > what the value actually is. Zero happens to be convenient. Using memset(addr, 0, size) to clear a structure is certainly not machine-independent. You have no idea whether the compiler represents integer zero, null pointers, floating-point zeros, etc. as a series of zero bytes or not. Using memset this way is not typesafe. (No, I don't think this ``concern'' has any practical consequence. I have no opinion on the actual issue. I just want to be a smarty pants.)