From: Joel Brobecker <brobecker@adacore.com>
To: Pavel Kryukov <kryukov@frtk.ru>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Include <stdlib.h> to cp1.c for abort() declaration
Date: Sun, 13 Dec 2020 18:10:25 +0400 [thread overview]
Message-ID: <20201213141025.GI366101@adacore.com> (raw)
In-Reply-To: <20201212124528.1095-1-kryukov@frtk.ru>
> sim/mips/ChangeLog:
>
> * cp1.c: Include <stdlib.h>
:-/. Using "abort" in the sim is not a good idea, because the sim
can be built into GDB. So imagine the scenario where a user uses
an invalid switch as the sim calls "abort", instead of just reporting
the error to the user and letting him try again, the debugging session
just abort...
However, in this particular case, the use of aborts is not your fault,
and it's probably not new either, so it makes sense to include
the corresponding system header.
The patch is OK for me. Please feel free to push (do you have push
permissions?).
> ---
> sim/mips/ChangeLog | 4 ++++
> sim/mips/cp1.c | 2 ++
> 2 files changed, 6 insertions(+)
>
> diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
> index 7ced3edd1b..f9a1eb96c6 100644
> --- a/sim/mips/ChangeLog
> +++ b/sim/mips/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-12-12 Pavel I. Kryukov <kryukov@frtk.ru>
> +
> + * cp1.c: Include <stdlib.h>.
> +
> 2020-07-29 Simon Marchi <simon.marchi@efficios.com>
>
> * configure: Re-generate.
> diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
> index 82fdea2bcb..d81b07a20c 100644
> --- a/sim/mips/cp1.c
> +++ b/sim/mips/cp1.c
> @@ -42,6 +42,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> #include "sim-main.h"
>
> +#include <stdlib.h>
> +
> /* Within cp1.c we refer to sim_cpu directly. */
> #define CPU cpu
> #define SD CPU_STATE(cpu)
> --
> 2.17.1
--
Joel
next prev parent reply other threads:[~2020-12-13 14:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-12 12:45 Pavel Kryukov
2020-12-13 14:10 ` Joel Brobecker [this message]
2020-12-13 16:27 ` Pavel I. Kryukov
2020-12-14 3:03 ` Joel Brobecker
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=20201213141025.GI366101@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=kryukov@frtk.ru \
/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