🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1521

Optional vs. required diagnostics

#1521
From: Karl Heuer
Date: Tue, 24 Jul 1990 23:56
18 lines
1645 bytes
Must the following code fragments generate a diagnostic?
	/* [0] */ double *p;   int x;   p = &x;
	/* [1] */ void f(double *p);   int x;   f(&x);

[0] is illegal because of 3.3.4 ("Conversions that involve pointers (other
than ...) shall be specified by means of an explicit cast"), but since it
appears under Semantics rather than Constraints, it seems to be merely a
case of undefined behavior, and hence the compiler may choose to be silent.

[1] is similar, but the place where 3.3.2.2 requires assignment-compatibility
for prototype arguments *is* under the Constraints section.  Does this cause
the implicit reference to 3.3.4 to be covered by the 3.3.2.2 Constraints
for this particular case, and hence require a diagnostic?  Or can an
implementation choose to accept [0] as a Conforming Extension and then claim
that [1] does not violate 3.3.2.2, since, *in this implementation*, the
actual and formal parameters *are* assignment-compatible?

Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint
Technical Details
Message-ID: <17144@haddock.ima.isc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!deccrl!decvax.dec.com!ima!haddock!karl
References: <1990Jul20.184748.4362@lotus.com> <7330027@hpcllca.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!deccrl!decvax.dec.com!ima!haddock!karl
From: karl@haddock.ima.isc.com (Karl Heuer)
Newsgroups: comp.std.c
Subject: Optional vs. required diagnostics
Summary: was: VAX C Doesn't care about prototypes.
Message-ID: <17144@haddock.ima.isc.com>
Date: 24 Jul 90 23:56:04 GMT
References: <1990Jul20.184748.4362@lotus.com> <7330027@hpcllca.HP.COM>
Reply-To: karl@kelp.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Cambridge, MA 02138-5302
Lines: 18