binutils: build rclex.c and mclex.c with -Werror
Compile binutils lexer files with -Werror to catch new warnings.
Simon Marchi proposes to remove custom build rules for rclex.c and mclex.c that currently bypass the -Werror flag. These files are now hand-written and should be subject to the same strict warning policy as other source files. This change aims to prevent new warnings in these files from going unnoticed.
- proposer
Proposes removing special build rules for `rclex.c` and `mclex.c` to enable `-Werror`.
“rclex.c and mclex.c are compiled with $(NO_WERROR), so new warnings in them go unnoticed. This made sense when rclex.c was generated by flex from rclex.l, but rclex.c was replaced by a hand-written lexer in commit 4a594fce1668 ("Updated windres tool", 2007-05-23). mclex.c, added shortly after, has always been hand-written and got the same special rule. Remove the custom rules for rclex and mcl…”
In Details
This patch modifies the build system (Makefile.am, Makefile.in) for binutils to remove special handling for rclex.c and mclex.c. Previously, these files were compiled with $(NO_WERROR), preventing compilation errors even if warnings were present. This was historically due to them being flex-generated, but they are now hand-written. By removing these custom rules, the files will be compiled with the default -Werror flag, ensuring that any new warnings are treated as errors and thus fixed.
- -Werror
- A compiler flag that treats all compiler warnings as errors, causing the build to fail if any warnings are detected.
- rclex.c
- A C source file containing a lexer for parsing resource compiler directives, now hand-written.
- mclex.c
- A C source file containing a lexer for parsing message compiler directives, hand-written.
- flex
- A fast lexical analyzer generator that produces C source code for C scanners.