public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Alexandre Oliva <oliva@adacore.com>
Cc: fortran@gcc.gnu.org
Subject: Re: [PATCH] Introduce hardbool attribute for C
Date: Thu, 06 Apr 2023 13:10:22 +0200	[thread overview]
Message-ID: <6890D6BA-73DC-4F91-9413-228492A7F09B@gmail.com> (raw)
In-Reply-To: <orzg7l8rr4.fsf@lxoliva.fsfla.org>

On 6 April 2023 08:11:11 CEST, Alexandre Oliva <oliva@adacore.com> wrote:
>On Apr  2, 2023, Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> wrote:
>
>> On Tue, 09 Aug 2022 10:53:08 -0300
>> Alexandre Oliva via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>
>>> Ping? (sorry, Joseph, I failed to Cc: you last time)
>
>> Didn't move yet did it.
>
>'fraid not, and surely it's too late for it to make gcc-13.
>

In fortran we have the following per the language:

---8<---
5 18.2.2 Named constants and derived types in the module
26 1 The entities listed in the second column of Table 18.2 shall be default integer named constants.
27 2 A Fortran intrinsic type whose kind type parameter is one of the values in the module shall have the same
28 representation as the C type with which it interoperates, for each value that a variable of that type can have.
29 For C_BOOL, the internal representation of .TRUE._C_BOOL and .FALSE._C_BOOL shall be the same as those of
30 the C values (_Bool)1 and (_Bool)0 respectively.

[]

12 5 The value of C_BOOL shall be a valid value for a logical kind parameter on the processor or shall be −1.
---8<---
thus we should probably be careful as i guess this might not work interoperable out of the box, fwiw. Not sure how realistic such a usecase would be..

I personally like your proposed 0 and ~0, that's probably pretty robust.
thanks,

       reply	other threads:[~2023-04-06 11:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <orlet4lmn8.fsf@lxoliva.fsfla.org>
     [not found] ` <or8rnxttff.fsf@lxoliva.fsfla.org>
     [not found]   ` <20230403012803.29ccf00b@nbbrfq>
     [not found]     ` <orzg7l8rr4.fsf@lxoliva.fsfla.org>
2023-04-06 11:10       ` Bernhard Reutner-Fischer [this message]
2023-06-16  5:39         ` Alexandre Oliva
2023-06-16  6:52           ` Thomas Koenig
2023-06-16  8:03             ` Alexandre Oliva
     [not found]   ` <oredmcx940.fsf@lxoliva.fsfla.org>
2023-06-19 18:48     ` Bernhard Reutner-Fischer
2023-06-22  1:08       ` Alexandre Oliva
2023-06-22 21:15         ` Bernhard Reutner-Fischer
2023-06-24  2:57           ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6890D6BA-73DC-4F91-9413-228492A7F09B@gmail.com \
    --to=rep.dot.nop@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=oliva@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).