From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: igen: add missing newline to various error messages
Date: Thu, 10 Nov 2022 00:34:49 +0700 [thread overview]
Message-ID: <20221109173449.27434-1-vapier@gentoo.org> (raw)
The error() function expects a trailing newline in its message.
Most callers do this already, so adding it to the few that don't.
---
sim/igen/gen-support.c | 2 +-
sim/igen/gen.c | 2 +-
sim/igen/ld-insn.c | 2 +-
sim/igen/misc.c | 2 +-
sim/igen/misc.h | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sim/igen/gen-support.c b/sim/igen/gen-support.c
index de5a507753a1..d9d0f7c09a65 100644
--- a/sim/igen/gen-support.c
+++ b/sim/igen/gen-support.c
@@ -180,7 +180,7 @@ support_c_function (lf *file, function_entry * function, void *data)
lf_printf (file, "{\n");
lf_indent (file, +2);
if (function->code == NULL)
- error (function->line, "Function without body (or null statement)");
+ error (function->line, "Function without body (or null statement)\n");
lf_print__line_ref (file, function->code->line);
table_print_code (file, function->code);
if (function->is_internal)
diff --git a/sim/igen/gen.c b/sim/igen/gen.c
index d2a40d194b03..3882b5bd34a2 100644
--- a/sim/igen/gen.c
+++ b/sim/igen/gen.c
@@ -987,7 +987,7 @@ gen_entry_expand_opcode (gen_entry *table,
}
if (bit == NULL && t == NULL)
error (instruction->line,
- "Conditional `%s' of field `%s' isn't expanded",
+ "Conditional `%s' of field `%s' isn't expanded\n",
condition->string, field->val_string);
switch (condition->test)
{
diff --git a/sim/igen/ld-insn.c b/sim/igen/ld-insn.c
index 20c1f77b33fb..435bf483efd7 100644
--- a/sim/igen/ld-insn.c
+++ b/sim/igen/ld-insn.c
@@ -914,7 +914,7 @@ static table_entry *
parse_macro_record (table *file, table_entry *record)
{
#if 1
- error (record->line, "Macros are not implemented");
+ error (record->line, "Macros are not implemented\n");
#else
/* parse the define record */
if (record->nr_fields < nr_define_fields)
diff --git a/sim/igen/misc.c b/sim/igen/misc.c
index 598f886d7ae0..c5c494bb6b5c 100644
--- a/sim/igen/misc.c
+++ b/sim/igen/misc.c
@@ -246,7 +246,7 @@ name2i (const char *names, const name_map * map)
if (curr->i >= 0)
return curr->i;
else
- error (NULL, "%s contains no valid names", names);
+ error (NULL, "%s contains no valid names\n", names);
return 0;
}
diff --git a/sim/igen/misc.h b/sim/igen/misc.h
index a1cae768179f..214505a761fb 100644
--- a/sim/igen/misc.h
+++ b/sim/igen/misc.h
@@ -64,7 +64,7 @@ do { \
line_ref line; \
line.file_name = filter_filename (__FILE__); \
line.line_nr = __LINE__; \
- error (&line, EXPRESSION); \
+ error (&line, EXPRESSION "\n"); \
} while (0)
#define ASSERT(EXPRESSION) \
@@ -73,7 +73,7 @@ do { \
line_ref line; \
line.file_name = filter_filename (__FILE__); \
line.line_nr = __LINE__; \
- error(&line, "assertion failed - %s\n", #EXPRESSION); \
+ error (&line, "assertion failed - %s\n", #EXPRESSION); \
} \
} while (0)
--
2.38.1
reply other threads:[~2022-11-09 17:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221109173449.27434-1-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@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).