* [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:02 Dr. David Alan Gilbert (git)
2019-04-15 12:03 ` Samuel Thibault
2019-04-15 12:07 ` no-reply
0 siblings, 2 replies; 7+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-04-15 12:02 UTC (permalink / raw)
To: qemu-devel, samuel.thibault, jan.kiszka
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Gcc 9 needs some convincing that sopreprbuf really is going to fill
in iov in the call from soreadbuf, even though the failure case
shouldn't happen.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
slirp/src/socket.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/slirp/src/socket.c b/slirp/src/socket.c
index 4a3c935e25..beb8517f1c 100644
--- a/slirp/src/socket.c
+++ b/slirp/src/socket.c
@@ -181,7 +181,7 @@ soread(struct socket *so)
* No need to check if there's enough room to read.
* soread wouldn't have been called if there weren't
*/
- sopreprbuf(so, iov, &n);
+ assert(sopreprbuf(so, iov, &n) != 0);
nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
if (nn <= 0) {
@@ -257,6 +257,7 @@ int soreadbuf(struct socket *so, const char *buf, int size)
* No need to check if there's enough room to read.
* soread wouldn't have been called if there weren't
*/
+ assert(size > 0);
if (sopreprbuf(so, iov, &n) < size)
goto err;
--
2.21.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:03 ` Samuel Thibault
0 siblings, 0 replies; 7+ messages in thread
From: Samuel Thibault @ 2019-04-15 12:03 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, jan.kiszka
Dr. David Alan Gilbert (git), le lun. 15 avril 2019 13:02:05 +0100, a ecrit:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Gcc 9 needs some convincing that sopreprbuf really is going to fill
> in iov in the call from soreadbuf, even though the failure case
> shouldn't happen.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> slirp/src/socket.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/slirp/src/socket.c b/slirp/src/socket.c
> index 4a3c935e25..beb8517f1c 100644
> --- a/slirp/src/socket.c
> +++ b/slirp/src/socket.c
> @@ -181,7 +181,7 @@ soread(struct socket *so)
> * No need to check if there's enough room to read.
> * soread wouldn't have been called if there weren't
> */
> - sopreprbuf(so, iov, &n);
> + assert(sopreprbuf(so, iov, &n) != 0);
Please make this through a variable, otherwise anybody building with
-DNDEBUG will get sopreprbuf not being called.
> nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
> if (nn <= 0) {
> @@ -257,6 +257,7 @@ int soreadbuf(struct socket *so, const char *buf, int size)
> * No need to check if there's enough room to read.
> * soread wouldn't have been called if there weren't
> */
> + assert(size > 0);
> if (sopreprbuf(so, iov, &n) < size)
> goto err;
>
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:03 ` Samuel Thibault
0 siblings, 0 replies; 7+ messages in thread
From: Samuel Thibault @ 2019-04-15 12:03 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: jan.kiszka, qemu-devel
Dr. David Alan Gilbert (git), le lun. 15 avril 2019 13:02:05 +0100, a ecrit:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Gcc 9 needs some convincing that sopreprbuf really is going to fill
> in iov in the call from soreadbuf, even though the failure case
> shouldn't happen.
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> slirp/src/socket.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/slirp/src/socket.c b/slirp/src/socket.c
> index 4a3c935e25..beb8517f1c 100644
> --- a/slirp/src/socket.c
> +++ b/slirp/src/socket.c
> @@ -181,7 +181,7 @@ soread(struct socket *so)
> * No need to check if there's enough room to read.
> * soread wouldn't have been called if there weren't
> */
> - sopreprbuf(so, iov, &n);
> + assert(sopreprbuf(so, iov, &n) != 0);
Please make this through a variable, otherwise anybody building with
-DNDEBUG will get sopreprbuf not being called.
> nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
> if (nn <= 0) {
> @@ -257,6 +257,7 @@ int soreadbuf(struct socket *so, const char *buf, int size)
> * No need to check if there's enough room to read.
> * soread wouldn't have been called if there weren't
> */
> + assert(size > 0);
> if (sopreprbuf(so, iov, &n) < size)
> goto err;
>
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:15 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2019-04-15 12:15 UTC (permalink / raw)
To: Samuel Thibault; +Cc: qemu-devel, jan.kiszka
* Samuel Thibault (samuel.thibault@gnu.org) wrote:
> Dr. David Alan Gilbert (git), le lun. 15 avril 2019 13:02:05 +0100, a ecrit:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > Gcc 9 needs some convincing that sopreprbuf really is going to fill
> > in iov in the call from soreadbuf, even though the failure case
> > shouldn't happen.
> >
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> > slirp/src/socket.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/slirp/src/socket.c b/slirp/src/socket.c
> > index 4a3c935e25..beb8517f1c 100644
> > --- a/slirp/src/socket.c
> > +++ b/slirp/src/socket.c
> > @@ -181,7 +181,7 @@ soread(struct socket *so)
> > * No need to check if there's enough room to read.
> > * soread wouldn't have been called if there weren't
> > */
> > - sopreprbuf(so, iov, &n);
> > + assert(sopreprbuf(so, iov, &n) != 0);
>
> Please make this through a variable, otherwise anybody building with
> -DNDEBUG will get sopreprbuf not being called.
Coming up.
Dave
> > nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
> > if (nn <= 0) {
> > @@ -257,6 +257,7 @@ int soreadbuf(struct socket *so, const char *buf, int size)
> > * No need to check if there's enough room to read.
> > * soread wouldn't have been called if there weren't
> > */
> > + assert(size > 0);
> > if (sopreprbuf(so, iov, &n) < size)
> > goto err;
> >
> > --
> > 2.21.0
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:15 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2019-04-15 12:15 UTC (permalink / raw)
To: Samuel Thibault; +Cc: jan.kiszka, qemu-devel
* Samuel Thibault (samuel.thibault@gnu.org) wrote:
> Dr. David Alan Gilbert (git), le lun. 15 avril 2019 13:02:05 +0100, a ecrit:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > Gcc 9 needs some convincing that sopreprbuf really is going to fill
> > in iov in the call from soreadbuf, even though the failure case
> > shouldn't happen.
> >
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> > slirp/src/socket.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/slirp/src/socket.c b/slirp/src/socket.c
> > index 4a3c935e25..beb8517f1c 100644
> > --- a/slirp/src/socket.c
> > +++ b/slirp/src/socket.c
> > @@ -181,7 +181,7 @@ soread(struct socket *so)
> > * No need to check if there's enough room to read.
> > * soread wouldn't have been called if there weren't
> > */
> > - sopreprbuf(so, iov, &n);
> > + assert(sopreprbuf(so, iov, &n) != 0);
>
> Please make this through a variable, otherwise anybody building with
> -DNDEBUG will get sopreprbuf not being called.
Coming up.
Dave
> > nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
> > if (nn <= 0) {
> > @@ -257,6 +257,7 @@ int soreadbuf(struct socket *so, const char *buf, int size)
> > * No need to check if there's enough room to read.
> > * soread wouldn't have been called if there weren't
> > */
> > + assert(size > 0);
> > if (sopreprbuf(so, iov, &n) < size)
> > goto err;
> >
> > --
> > 2.21.0
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:07 ` no-reply
0 siblings, 0 replies; 7+ messages in thread
From: no-reply @ 2019-04-15 12:07 UTC (permalink / raw)
To: dgilbert; +Cc: fam, qemu-devel, samuel.thibault, jan.kiszka
Patchew URL: https://patchew.org/QEMU/20190415120205.2221-1-dgilbert@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20190415120205.2221-1-dgilbert@redhat.com
Subject: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/20190415120205.2221-1-dgilbert@redhat.com -> patchew/20190415120205.2221-1-dgilbert@redhat.com
Switched to a new branch 'test'
81e4d9dd83 slirp: Gcc 9 -O3 fix
=== OUTPUT BEGIN ===
ERROR: code indent should never use tabs
#23: FILE: slirp/src/socket.c:184:
+^Iassert(sopreprbuf(so, iov, &n) != 0);$
ERROR: code indent should never use tabs
#31: FILE: slirp/src/socket.c:260:
+^Iassert(size > 0);$
total: 2 errors, 0 warnings, 15 lines checked
Commit 81e4d9dd83e0 (slirp: Gcc 9 -O3 fix) has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/20190415120205.2221-1-dgilbert@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
@ 2019-04-15 12:07 ` no-reply
0 siblings, 0 replies; 7+ messages in thread
From: no-reply @ 2019-04-15 12:07 UTC (permalink / raw)
To: dgilbert; +Cc: fam, jan.kiszka, qemu-devel, samuel.thibault
Patchew URL: https://patchew.org/QEMU/20190415120205.2221-1-dgilbert@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Message-id: 20190415120205.2221-1-dgilbert@redhat.com
Subject: [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/20190415120205.2221-1-dgilbert@redhat.com -> patchew/20190415120205.2221-1-dgilbert@redhat.com
Switched to a new branch 'test'
81e4d9dd83 slirp: Gcc 9 -O3 fix
=== OUTPUT BEGIN ===
ERROR: code indent should never use tabs
#23: FILE: slirp/src/socket.c:184:
+^Iassert(sopreprbuf(so, iov, &n) != 0);$
ERROR: code indent should never use tabs
#31: FILE: slirp/src/socket.c:260:
+^Iassert(size > 0);$
total: 2 errors, 0 warnings, 15 lines checked
Commit 81e4d9dd83e0 (slirp: Gcc 9 -O3 fix) has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/20190415120205.2221-1-dgilbert@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-04-15 12:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-15 12:02 [Qemu-devel] [PATCH v2] slirp: Gcc 9 -O3 fix Dr. David Alan Gilbert (git)
2019-04-15 12:03 ` Samuel Thibault
2019-04-15 12:03 ` Samuel Thibault
2019-04-15 12:15 ` Dr. David Alan Gilbert
2019-04-15 12:15 ` Dr. David Alan Gilbert
2019-04-15 12:07 ` no-reply
2019-04-15 12:07 ` no-reply
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.