Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Pointer arithmetic Message-ID: <14803@smoke.brl.mil> Date: 10 Jan 91 15:54:06 GMT References: <1991Jan7.173726.1003@alias.uucp> <14794@smoke.brl.mil> <15486@crdgw1.crd.ge.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 23 In article <15486@crdgw1.crd.ge.com> volpe@camelback.crd.ge.com (Christopher R Volpe) writes: >In article <14794@smoke.brl.mil>, gwyn@smoke.brl.mil (Doug Gwyn) writes: >|>strictly conforming and thus the C implementation should NOT issue a >|>diagnostic. >I assume you mean "should NOT fail to generate correct code", right? >It can, of course, issue a diagnostic if it's raining outside or if >it's past 5:00pm on a Friday. No, I used the term "should not" advisedly. A quality ANSI C implementation should not generate "diagnostics" for a strictly conforming program that are indistinguishable from the ones required by the standard to be generated for violations of syntax rules and constraints. Note that I did not say "must not" (as in the sense that the implementation would not be standard conforming if it did); however, customers have a reasonable right to expect diagnostics to be useful, and spurious ones that announce errors where there are none are an indication of poor product quality. Some people might want the option to generate "warnings" that are readily distinguishable from "error" diagnostics, for example a la UNIX "lint -p"; in the absence of other lint-like support this would be a helpful feature. However, I would hope that such warnings could be easily suppressed, since many legitimate applications of C involve deliberate exploitation of specific features of an implementation. While I strongly discourage unnecessary implementation dependency in application code, there are times when it really is needed.