From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 525693858D32 for ; Thu, 6 Apr 2023 11:10:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 525693858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9338d479a21so118803366b.1 for ; Thu, 06 Apr 2023 04:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680779427; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=QUuv49iDQElYJEHFDmyf78DpAsRNTmpJa3XHfuBUXOs=; b=eHfr+Q8mR5hzkjuxMz66di38BL1hTnUgCPVixSvy8Ka9hwqt1Rnq2LtIxEUpioFktR eJxb5P0nDSkxU6gsGB93Afv7TCrbPv60YGbynXBkEcOVKeQZzf1656p4YFCwv49iHlcW 2CrG635BRUa2SPHJzjMmtLgkzGOhPlcTXzxOAkcKeXxfbaZwtYCKnabJDm+8zVGpc8nQ 4LytMOcx9peUf0aIFpnrV9VxRnbLsVlFXAVK8DTwcuWrEl16m5RHrfj/Q7rxdPVJ2qXn +0/8PHjVybLWrXiA5Jq6IksFRB8kqPfcGCvMXQWJfxd7/J6QLnMihR1APHmvr3zM+miv x40Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680779427; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QUuv49iDQElYJEHFDmyf78DpAsRNTmpJa3XHfuBUXOs=; b=mYbOYyxCBdp5O5pfgnD1Q03mAwV7dnMemEgR3Q5o3m3hvJOXyOwRMIQwFpahIueHAV YYvNuHjXB0Y1/CyCnJqDoHirIbdbbEcJ1UaADbelAsFFUhO1sHW0Z1DsD0P/U7s1JZjm RL+v4UVw+BzULOgWXonyMCBtlW1N74JEFTNkJWA2yEcU0aYXTSFdKP6XWrqfNDxr5beZ Y5VvBkUDaSj55p5hZVZkQmt8o61g4Wv2GxnunMIxmLprSnrO39q7q93y9ZvyFm+Z8wvp 7LO9Lbm/tOCgEycZw9yiptVZgzRpN5YYi2UCGfpknMDWVSOxzRhje098g9wTlA187nOV ELvQ== X-Gm-Message-State: AAQBX9dlaMSDdlFazt4Pt11WuDZ8vfvjXHZ4fdaDc0w3t6NG0TRJRmEU rg7k1mY910462qQ6o7AswrF59LbaHGU= X-Google-Smtp-Source: AKy350ahK/DwDtKnNQswxTEeEKj5oin441V31rgQ0egvzYKS9hq69StF/iNoBpcIZVkNHcCmXVF43w== X-Received: by 2002:aa7:d5c5:0:b0:504:6646:79c4 with SMTP id d5-20020aa7d5c5000000b00504664679c4mr1000622eds.36.1680779426919; Thu, 06 Apr 2023 04:10:26 -0700 (PDT) Received: from ?IPv6:::1? ([2001:871:227:3412:10bb:72c9:e8a4:fc91]) by smtp.gmail.com with ESMTPSA id s18-20020a508d12000000b004fa268da13esm608234eds.56.2023.04.06.04.10.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Apr 2023 04:10:26 -0700 (PDT) Date: Thu, 06 Apr 2023 13:10:22 +0200 From: Bernhard Reutner-Fischer To: Alexandre Oliva CC: fortran@gcc.gnu.org Subject: Re: [PATCH] Introduce hardbool attribute for C In-Reply-To: References: <20230403012803.29ccf00b@nbbrfq> Message-ID: <6890D6BA-73DC-4F91-9413-228492A7F09B@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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: On 6 April 2023 08:11:11 CEST, Alexandre Oliva wrote: >On Apr 2, 2023, Bernhard Reutner-Fischer w= rote: > >> On Tue, 09 Aug 2022 10:53:08 -0300 >> Alexandre Oliva via Gcc-patches wrote: > >>> Ping? (sorry, Joseph, I failed to Cc: you last time) > >> Didn't move yet did it=2E > >'fraid not, and surely it's too late for it to make gcc-13=2E > In fortran we have the following per the language: ---8<--- 5 18=2E2=2E2 Named constants and derived types in the module 26 1 The entities listed in the second column of Table 18=2E2 shall be def= ault integer named constants=2E 27 2 A Fortran intrinsic type whose kind type parameter is one of the valu= es in the module shall have the same 28 representation as the C type with which it interoperates, for each valu= e that a variable of that type can have=2E 29 For C_BOOL, the internal representation of =2ETRUE=2E_C_BOOL and =2EFAL= SE=2E_C_BOOL shall be the same as those of 30 the C values (_Bool)1 and (_Bool)0 respectively=2E [] 12 5 The value of C_BOOL shall be a valid value for a logical kind paramet= er on the processor or shall be =E2=88=921=2E ---8<--- thus we should probably be careful as i guess this might not work interope= rable out of the box, fwiw=2E Not sure how realistic such a usecase would b= e=2E=2E I personally like your proposed 0 and ~0, that's probably pretty robust=2E thanks,