Article View: comp.std.c++
Article #2581Re: Undefined behavior [was: Virtual functions and destructors]
From: Steve Clamage
Date: Mon, 13 Nov 1995 23:04
Date: Mon, 13 Nov 1995 23:04
43 lines
2198 bytes
2198 bytes
In article HF8@falcon.daytonoh.attgis.com, Dick Menninger <Dick.Menninger@daytonoh.attgis.com> writes: > >Actually, "undefined behavior" is a precisely >defined term in the WP, and not just a vague >common term. Well, yes, sort of. > The meanings are constrained (1.3) >by text that starts "Permissible undefined behavior >ranges from" and then give three categories >of behavior that are permissible. ... Not quite. The definition of undefined behavior is given as "Behavior ... for which the standard imposes no requirements." (1.3 Definitions). The paragraph goes on to give examples of possible responses, but does limit reponses to those examples. In addition, section 1.7 "Processor compliance" pp 2 says: "If an ill-formed program contains no diagnosable errors, this International Standard places no requirements on implementations with respect to that program." I don't see how the standard could be more explicit than that: "undefined behavior" means undefined behavior. The standard imposes NO requirements. Finally, the C++ draft standard is different from the C standard in an important way regarding undefined behavior. In the C standard, violation of a "shall" clause outside a "constraint" section results in undefined behavior. The C++ draft standard has no "constraint" sections. Instead, violation of a "shall" clause requires a diagnostic message unless the clause is marked otherwise. --- Steve Clamage, stephen.clamage@eng.sun.com --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<488ggg$prm@engnews1.eng.sun.com>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<DHzqpv.HF8@falcon.daytonoh.attgis.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: clamage@Eng.Sun.COM (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: Undefined behavior [was: Virtual functions and destructors] Date: 13 Nov 1995 23:04:06 GMT Organization: Sun Microsystems Inc. Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <488ggg$prm@engnews1.eng.sun.com> References: <DHzqpv.HF8@falcon.daytonoh.attgis.com> Reply-To: clamage@Eng.Sun.COM NNTP-Posting-Host: physics2.berkeley.edu