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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham 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!news2.google.com!news.glorb.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!b680011b!not-for-mail From: Dick Hendrickson User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: another way to shoot yourself in the foot? 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: b7ad91bbe73e2af2f6f00c749335c20a X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1215722703 b7ad91bbe73e2af2f6f00c749335c20a (Thu, 10 Jul 2008 20:45:03 GMT) NNTP-Posting-Date: Thu, 10 Jul 2008 20:45:03 GMT Organization: AT&T Worldnet Date: Thu, 10 Jul 2008 20:45:03 GMT Xref: g2news1.google.com comp.lang.ada:1092 comp.lang.fortran:2600 Date: 2008-07-10T20:45:03+00:00 List-Id: James Giles wrote: > Craig Powers wrote: >> Dick Hendrickson wrote: >>> Colin Paul Gloster wrote: >>>> Does Fortran always automatically check if the INTERFACE actually >>>> corresponds to the code? >>>> >>> Depends on the compiler, but in general NO. I think all >>> compilers will detect an explicit assignment to a dummy >>> argument that has INTENT(IN) in the subroutine; I'm not sure >>> any will detect an assignment if the dummy is passed on >>> to another routine and that routine (illegally) assigns to >>> its argument. >> 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. Dick Hendrickson