From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7041 invoked by alias); 15 Feb 2008 07:18:01 -0000 Received: (qmail 5986 invoked by uid 48); 15 Feb 2008 07:17:17 -0000 Date: Fri, 15 Feb 2008 07:18:00 -0000 Message-ID: <20080215071717.5985.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/35203] OPTIONAL, VALUE actual argument cannot be an INTEGER 0 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg01630.txt.bz2 ------- Comment #6 from burnus at gcc dot gnu dot org 2008-02-15 07:17 ------- > As I am at a WG5 just right now, I decided to ask. Allowing OPTIONAL,VALUE > was a conscious decision by the Committee (although not necessarily an > unanimous one :-) Can you ask the other vendors how they plan to implement it? Or if you find a non-vendor proponent, how he would implement it. For a pointer (C sense) it is easy: if (pointer == NULL) -> check for presence if (*pointer == 0) -> check for its value But if I have a value, there is no chance to check for it directly - except for passing a hidden argument; unless we can convince J3/WG5 to change their opinion, that is what I propose to do. The hidden argument would then be added after the character length arguments. As written, I checked all my compilers and all get a wrong result - gfortran, g95, NAG f95: NOT PRESENT - ifort: PRESENT, WITH VALUE: 0 (even if not present) (ifort 10 and ifort 10.1 print a warning that present should not be used with value; ifort 9 give the same run-time result, but does not have the warning) - sunf95: Compile-time error: OPTIONAL and VALUE may not be used both (While we are at it: Please make sure that OPTION + VALUE + BIND(C) will not be allowed in the upcoming interoperability TR; if it is included, there should be a note giving implementation suggestions. F2003 is unaffected by this as OPTIONAL is not allowed with BIND(C).) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35203