Commit: GAS: Add option to warn about multibyte characters

Thomas Wolff towo@towo.net
Thu Nov 18 19:34:33 GMT 2021


Am 18.11.2021 um 17:47 schrieb Nick Clifton via Binutils:
> Hi Guys,
>
>    I am applying the patch below to add a new option to the assembler.
>    The option enables the generation of warning messages when multibyte
>    characters are found in the input.  It has two modes, in the first it
>    will warn about multibyte characters detected anywhere in the input
>    stream.
Why should one ever check against international characters in comments 
or strings?
This is asking for trouble with people who legitimately use them when 
working with some automatisation scripts that obstruct them. I think 
this version of the option is more than dispensable.
Thomas

> In the second mode the warnings are only generated when
>    multibyte characters are used in the names of defined symbols.  The
>    point of the second mode is that whilst there may be good reasons for
>    multibyte characters to appear in the input - in comments, output
>    strings, and so on, it is rare that they will be used in symbol names.
>
> Cheers
>    Nick
>    
> gas/ChangeLog
> 2021-11-18  Nick Clifton  <nickc@redhat.com>
>
> 	* as.c (parse_args): Add support for --multibyte-handling.
> 	* as.h (multibyte_handling): Declare.
> 	* app.c (scan_for_multibyte_characters): New function.
> 	(do_scrub_chars): Call the new function if multibyte warning is
> 	enabled.
> 	* input-scrub,c (input_scrub_next_buffer): Call the multibyte
> 	scanning function if multibyte warnings are enabled.
> 	* symbols.c (struct symbol_flags): Add multibyte_warned bit.
> 	(symbol_init): Call the multibyte scanning function if multibyte
> 	symbol warnings are enabled.
> 	(S_SET_SEGMENT): Likewise.
> 	* NEWS: Mention the new feature.
> 	* doc/as.texi: Document the new feature.
> 	* testsuite/gas/all/multibyte.s: New test source file.
> 	* testsuite/gas/all/multibyte1.d: New test driver file.
> 	* testsuite/gas/all/multibyte1.l: New test expected output.
> 	* testsuite/gas/all/multibyte2.d: New test driver file.
> 	* testsuite/gas/all/multibyte2.l: New test expected output.
> 	* testsuite/gas/all/gas.exp: Run the new tests.
>



More information about the Binutils mailing list