From: Jeff Johnston <jjohnstn@redhat.com>
To: Marc <dkm+newlib@kataplop.net>
Cc: newlib@sourceware.org
Subject: Re: [PATCH] libgloss: fix read and write prototype
Date: Mon, 6 May 2024 19:17:46 -0400 [thread overview]
Message-ID: <CAOox84tY-Pv2X8TEXK76CW5fTLZKJ12iwAEfbp+8U-T2bBiHdA@mail.gmail.com> (raw)
In-Reply-To: <87msp4ul1q.fsf@arrakis.kataplop.net>
[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]
Thanks Marc,
Patch applied.
-- Jeff J.
On Sun, May 5, 2024 at 3:16 PM Marc <dkm+newlib@kataplop.net> wrote:
> Use _READ_WRITE_RETURN_TYPE for read/write in libgloss/{read,write}.c to
> avoid mismatching types.
>
> Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
> ---
> Hello,
>
> building with gcc14-rc for m68k fails with (see my mail earlier this week):
>
> src/newlib/libgloss/m68k/../read.c:24:1: error: conflicting types for
> 'read'; have 'int(int, void *, size_t)' {aka 'int(int, void *, long
> unsigned int)'}
>
> This simple fix makes use of _READ_WRITE_RETURN_TYPE macro to avoid
> mismatching types.
>
> Marc
>
> libgloss/read.c | 2 +-
> libgloss/write.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libgloss/read.c b/libgloss/read.c
> index 83a3b549b..867648278 100644
> --- a/libgloss/read.c
> +++ b/libgloss/read.c
> @@ -20,7 +20,7 @@ extern char inbyte (void);
> * read -- read bytes from the serial port. Ignore fd, since
> * we only have stdin.
> */
> -int
> +_READ_WRITE_RETURN_TYPE
> read (int fd,
> void *buf_,
> size_t nbytes)
> diff --git a/libgloss/write.c b/libgloss/write.c
> index 80bcd4a77..757141291 100644
> --- a/libgloss/write.c
> +++ b/libgloss/write.c
> @@ -21,7 +21,7 @@ extern int outbyte (char x);
> * stdout and stderr are the same. Since we have no filesystem,
> * open will only return an error.
> */
> -int
> +_READ_WRITE_RETURN_TYPE
> write (int fd,
> const void *buf_,
> size_t nbytes)
> --
> 2.42.0
>
>
prev parent reply other threads:[~2024-05-06 23:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 19:16 Marc
2024-05-06 23:17 ` Jeff Johnston [this message]
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=CAOox84tY-Pv2X8TEXK76CW5fTLZKJ12iwAEfbp+8U-T2bBiHdA@mail.gmail.com \
--to=jjohnstn@redhat.com \
--cc=dkm+newlib@kataplop.net \
--cc=newlib@sourceware.org \
/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).