From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by sourceware.org (Postfix) with ESMTPS id 4A37F3858D20 for ; Tue, 1 Nov 2022 21:13:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A37F3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1667337196; bh=MGXSHmQ1/ROnB4WMjO9ocZieiyJ1My5i2O2y2ofr5QA=; h=X-UI-Sender-Class:From:To:Subject:Date; b=QgVHKZ8zrP3LSlctUj6Vrus/wX+CbNmB6L0i58hILNzK2+rN3zfOcWr5l/qxIJpbv zbTio6kYKaTPW5J4aHKc3oahZTuWgcK94HiuHDcOdq10sQZuaR7tSyPFfbJAFVdg2M huMR5BacJG+4pAFjkbwE9/zzWRoz6wEfptD9v4iAJVSCozujyMUQdBDqGu+pem8/hP lBD6IMYwK1RW0PnKCLa1DEy2dw+ou0+1ahlhPaigT0uQ3uLUwg9fSORj5uNxinp81M 87/MfmRjLFor2a+ILLZ0B6Y/LAOwOtvU6PfmO6TvAJFvdUI5Vr48ujfH5laeTu1HBi cXuG2TSTaVNrQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [93.207.81.115] ([93.207.81.115]) by web-mail.gmx.net (3c-app-gmx-bap32.server.lan [172.19.172.102]) (via HTTP); Tue, 1 Nov 2022 22:13:16 +0100 MIME-Version: 1.0 Message-ID: From: Harald Anlauf To: fortran Subject: ABI question: character, value, optional dummy argument [PR107444] Content-Type: text/plain; charset=UTF-8 Date: Tue, 1 Nov 2022 22:13:16 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:a8BkgW2KIRUMBmYxBORtqtAqr7h97gTViMIkdj7SwJOqz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aNQToMXcQni0nBPjmBFM7mUKdjVwrgJYdjMd0V9tgE8OA8FuJDVwkHlzf9P KjwOeMJDQPjVKIdYubsXa37g== X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Dear all, I apologize in advance in case I did not do sufficient research, but I need feedback on a question regarding the ABI that does not seem handled by https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html How do we determine if an actual argument corresponding to a character, value, optional dummy argument is present or not? subroutine s (c) character, value, optional :: c end gets translated on x86_64-pc-linux-gnu to void s (character(kind=1)[1:1] c, integer(kind=8) _c) We could: - add a hidden logical argument for the present status as done for other types (this would clearly be an explicit ABI change) - use the passed character length: if it is > 0, then the argument is present, otherwise it is not. (This may require dealing with invalid code, where invocation of the subroutine with a character(len=0) actual argument is either diagnosed as done by the NAG compiler, or treated as undefined behavior.) Thanks, Harald