Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Why no renew Keywords: initializing new memory with zeroes Message-ID: <635@taumet.com> Date: 27 Mar 91 01:04:36 GMT References: <1991Mar16.172814.6525@mathcs.sjsu.edu> <966@elan.Elan.COM> <1921@news.tcs.com> Organization: Taumetric Corporation, San Diego Lines: 30 gwu@nujoizey.tcs.com (George Wu) writes: > Concerning the ongoing debate of whether newly allocated objects should >have memory initialized to zero, I propose we make it a compiler command >line option... > Does this fall within the ANSI committee's mandate? Or is this idea >too implementation oriented for their more language definition role? The standardization effort cannot address issues such as command-line options. Not all compilers have command lines. "Compilation" might be distributed among various components of an integrated translation system. Taking the wider view, the C++ ANSI committee (X3J16) followed the lead of the C committee (X3J11) and rejected the idea of "optional features" or "levels of conformance". None of this prevents an implementation from providing additional features which do not conflict with requirements of the standard. Presumably nothing would prohibit the default 'operator new' from zeroing memory if an implementor felt this would be considered a benefit by potential customers. Personally, I think it would be more beneficial to set memory to 'impossible' values where this concept makes sense on a given architecture. Zeroing memory hides too many bugs involving uninitialized variables. (Unless zero is an 'impossible' value :-)). -- Steve Clamage, TauMetric Corp, steve@taumet.com