aboutsummaryrefslogtreecommitdiff
path: root/gas/app.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-07-11 12:26:36 +0200
committerJan Beulich <jbeulich@suse.com>2024-07-11 12:26:36 +0200
commit296597f53e2a3cf14eafdca4c3141f7a4a7ab14b (patch)
tree07478bc1dce3d0144deed7ef8b33eea5c47e0e4b /gas/app.c
parent8ea8012a8bddbc6fbbc86766a1df181cf133c5c6 (diff)
downloadbinutils-296597f53e2a3cf14eafdca4c3141f7a4a7ab14b.zip
binutils-296597f53e2a3cf14eafdca4c3141f7a4a7ab14b.tar.gz
binutils-296597f53e2a3cf14eafdca4c3141f7a4a7ab14b.tar.bz2
gas: multi-byte warning adjustments
First input_scrub_next_buffer()'s invocation was wrong, leading to input only being checked from the last newline till the end of the current buffer. Correcting the invocation, however, leads to duplicate checking unless -f (or the #NO_APP equivalent thereof) is in effect. Move the invocation to input_file_give_next_buffer(), to restrict it accordingly. Then, when macros contain multi-byte characters, warning about them again in every expansion isn't useful. Suppress such warnings from sb_scrub_and_add_sb().
Diffstat (limited to 'gas/app.c')
-rw-r--r--gas/app.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gas/app.c b/gas/app.c
index 955de0f..b268b66 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -406,7 +406,8 @@ scan_for_multibyte_characters (const unsigned char * start,
This is the way the old code used to work. */
size_t
-do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
+do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen,
+ bool check_multibyte)
{
char *to = tostart;
char *toend = tostart + tolen;
@@ -510,7 +511,7 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen)
from = input_buffer;
fromend = from + fromlen;
- if (multibyte_handling == multibyte_warn)
+ if (check_multibyte)
(void) scan_for_multibyte_characters ((const unsigned char *) from,
(const unsigned char* ) fromend,
true /* Generate warnings. */);