[PATCH] libga68: Fix posixstrerror by using the errnum parameter

Jose E. Marchesi jemarch@gnu.org
Sun Oct 19 18:26:17 GMT 2025


> On Sun, Oct 19, 2025, at 5:22 AM, Jose E. Marchesi wrote:
>> Hello Pietro.
>>
>> I applied the patch in a68 and is also part of the a68-v4 sent for
>> upstream review.
>>
>> Thanks!
>
> Thank you and thanks for doing the work to get the branch into shape
> and sending it for review!

:)

I wouldn't mind if someone could rebase the existing a68 on top of
releases/gcc-15 to update releases/gcc-15-a68 ...

>
> pietro
>
>>> Sent to the forge too: https://forge.sourceware.org/gcc/gcc-a68/pulls/7
>>>
>>> pietro
>>> ---8<---
>>> From: Pietro Monteiro <pietro@sociotechnical.xyz>
>>> Date: Sat, 11 Oct 2025 19:34:32 -0400
>>> Subject: [PATCH] libga68: Fix posixstrerror by using the errnum parameter
>>>
>>> Instead of using the `errnum' parameter as described in the documentation
>>> `_libga68_posixstrerror' used `_libga68_errno' to get the error
>>> message.  Fix this by passing `errnum' to `strerror'.
>>>
>>> ChangeLog:
>>>         * libga68/ga68-posix.c (_libga68_posixstrerror): Use `errnum'
>>>         to get the error string.
>>>
>>> Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
>>> ---
>>>  libga68/ga68-posix.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/libga68/ga68-posix.c b/libga68/ga68-posix.c
>>> index 653807df612..cd8104cdc51 100644
>>> --- a/libga68/ga68-posix.c
>>> +++ b/libga68/ga68-posix.c
>>> @@ -67,8 +67,8 @@ _libga68_posixperror (uint32_t *s, size_t len, size_t stride)
>>>  uint32_t *
>>>  _libga68_posixstrerror (int errnum, size_t *len)
>>>  {
>>> -  char *str = strerror (_libga68_errno);
>>> -  return _libga68_u8_to_u32 (str, strlen (str), NULL, len);
>>> +  const char *str = strerror (errnum);
>>> +  return _libga68_u8_to_u32 ((const uint8_t *)str, strlen (str), NULL, len);
>>>  }
>>>
>>>  #define FILE_O_DEFAULT 0x0


More information about the Algol68 mailing list