From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e859f774bbb3dfb3 X-Google-Thread: 1094ba,40d8c5edfa36ea47 X-Google-Attributes: gid103376,gid1094ba,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.visyn.net!news.svengo.de!news.motzarella.org!motzarella.org!not-for-mail From: Craig Powers Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: another way to shoot yourself in the foot? Date: Thu, 10 Jul 2008 17:29:27 -0400 Organization: A noiseless patient Spider Message-ID: References: <54157920-377a-441b-9b0b-f0c4f9ddffec@f36g2000hsa.googlegroups.com> <54435596-5e7f-4686-a2b7-1e22d7c4b186@p25g2000hsf.googlegroups.com> <_wPbk.7600$L_.4566@flpi150.ffdc.sbc.com> <1ijtbxq.1t7i71w700eykN%nospam@see.signature> <1ijv8ls.e6j4wyvizlw0N%nospam@see.signature> Reply-To: enigma@hal-pc.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: reader.motzarella.org U2FsdGVkX1+cyW86iBlJVi27990r9LUnCpw54fZqSb7rU91FK8ppV5duMvKSV8Jt+OdiIM+pBkQr2UyduEmMprgYaLNkNj3Ze9jt3kauUV5phgfqzR/eWA7VSx2WpmmePm0tSX8Op+qGe774B9oP6Q== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Thu, 10 Jul 2008 21:29:27 +0000 (UTC) In-Reply-To: <1ijv8ls.e6j4wyvizlw0N%nospam@see.signature> X-Auth-Sender: U2FsdGVkX1+lT5HJwWjQkd+XKtLWHPLy5e4wdEjMRLdNbE8I84yPog== Cancel-Lock: sha1:kU+EL8epKntl0ku+5drY+ocPeso= User-Agent: Thunderbird 1.5.0.10 (X11/20070301) Xref: g2news1.google.com comp.lang.ada:1095 comp.lang.fortran:2606 Date: 2008-07-10T17:29:27-04:00 List-Id: Richard Maine wrote: > Dick Hendrickson wrote: > >> James Giles wrote: >>> Craig Powers wrote: > >>>> Is that actually possible without lying about an interface? i.e. Is >>>> it possible to pass an INTENT(IN) dummy as an actual argument to a >>>> more permissive dummy argument in another routine (no intent or >>>> intent OUT) >>> It's not permitted. The standard doesn't require implementations to >>> verify that it's not done. That is, it's not one of the kinds of error >>> that the standard requires implementations to detect and report. >>> >> You're partially wrong, James. It is permitted to pass a dummy >> with INTENT(IN) to a subroutine that doesn't specify either >> INTENT(INOUT) or INTENT(OUT). You can pass them to a subroutine >> that doesn't specify intent and even potentially modifies >> its argument. You can't lie in an interface, but you can >> call routines that don't have an interface. Those routines are >> required to do the right thing; but the compiler isn't required >> to detect violations. > > I think you and James are saying the same thing. Your "those routines > are required to do the right thing" translates to James' "it is not > permitted [to do the wrong thing]". Both of you also say (correctly) > that the compiler isn't required to catch such an error. > > And note that I think this is a diferent matter than the original > question. I read the original question as "can you lie about the > interface [presumably referring to separate compilation of an interface > body and an external procedure]?" Presumably Craig was reading it > differently because with my reading "can you do this without lying about > an interface?" becomes a tautalogical (if that's a word) question. My "lying about the interface" question was about how you would end up with an INTENT(IN) dummy getting passed along to a mutable dummy. It had occurred to me that it might not be allowed to pass an INTENT(IN) into an unspecified intent, in which case lying about the interface (providing an interface block that didn't match the actual procedure) would be the only way to do it.