Article View: comp.std.c
Article #5452Implementation-defined
From: Jim Gardner
Date: Fri, 02 Dec 1988 20:18
Date: Fri, 02 Dec 1988 20:18
28 lines
1444 bytes
1444 bytes
[...] The important point about the term "implementation-defined" is that it applies to *behavior*. It is used in connection with code whose syntax and use is correct, but whose behavior can vary from machine to machine. A good example would be integer division with one negative value, as in (-9)/5 Of course, this is a perfectly good C expression, but implementations are allowed to choose either -1 or -2 as the result. In other words, the behavior will vary from system to system. In the above case, there are only two accepted behaviors (truncating towards zero or minus infinity). In other cases, there is a wide range of behavior possible. The standard says that when something has implementation-defined behavior, the behavior must be documented. The standard also says that constructs with implementation-defined behavior are correct...which means that the implementation is required to accept them. The implementation is still free to output warnings to its heart's content; the standard puts no restrictions on issuing warnings. Jim Gardner, University of Waterloo
Technical Details
Message-ID:
<22536@watmath.waterloo.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!jagardnerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!jagardner From: jagardner@watmath.waterloo.edu (Jim Gardner) Newsgroups: comp.std.c Subject: Implementation-defined Message-ID: <22536@watmath.waterloo.edu> Date: 2 Dec 88 20:18:00 GMT Reply-To: jagardner@watmath.waterloo.edu (Jim Gardner) Organization: U. of Waterloo, Ontario Lines: 28