From: Steve Ellcey <sellcey@cavium.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches <gdb-patches@sourceware.org>, simon.marchi@ericsson.com
Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c)
Date: Wed, 08 Aug 2018 17:49:00 -0000 [thread overview]
Message-ID: <1533750521.31481.18.camel@cavium.com> (raw)
In-Reply-To: <87wot092xy.fsf@tromey.com>
On Wed, 2018-08-08 at 11:35 -0600, Tom Tromey wrote:
>Â
> I haven't seen this, but IIRC some distros enable _FORTIFY_SOURCEÂ Â by
> default, which changes which unused-result warnings are emitted.
>
> Does the appended work for you?
>
> I wonder if we should enable _FORTIFY_SOURCE for development builds.
>
> Tom
>
> diff --git a/gdb/unittests/scoped_mmap-selftests.c
> b/gdb/unittests/scoped_mmap-selftests.c
> index d70a56a1862..e9d4afdffc5 100644
> --- a/gdb/unittests/scoped_mmap-selftests.c
> +++ b/gdb/unittests/scoped_mmap-selftests.c
> @@ -91,7 +91,7 @@ test_normal ()
> Â Â Â int fd = mkstemp (filename);
> Â Â Â SELF_CHECK (fd >= 0);
>
> -Â Â write (fd, "Hello!", 7);
> +Â Â SELF_CHECK (write (fd, "Hello!", 7) == 7);
> Â Â Â close (fd);
>
> Â Â Â gdb::unlinker unlink_test_file (filename);
Yes, this patch fixed the build problem I was having. Â I was building
on Ubuntu 16.04 so I guess that one of the platforms that enables
_FORTIFY_SOURCE by default.
Steve Ellcey
sellcey@cavium.com
prev parent reply other threads:[~2018-08-08 17:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 15:42 Steve Ellcey
2018-08-08 17:35 ` Tom Tromey
2018-08-08 17:39 ` Simon Marchi
2018-08-08 17:57 ` Tom Tromey
2018-08-08 22:17 ` Simon Marchi
2018-08-09 13:28 ` Pedro Alves
2018-08-09 14:34 ` Tom Tromey
2018-08-08 18:00 ` Tom Tromey
2018-08-08 17:49 ` Steve Ellcey [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=1533750521.31481.18.camel@cavium.com \
--to=sellcey@cavium.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
--cc=tom@tromey.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).