binutils Newspaper
NOVEMBER 30, 2026
binutils/mclex — Proposed

binutils/mclex: remove unused input_stream variable

Remove unused `input_stream` variable from binutils/mclex.c.

Simon Marchi proposes removing the unused input_stream variable from binutils/mclex.c. This variable has been obsolete since the addition of windmc, and only input_stream_pos is used for reading input. This change aims to clean up the code and resolve build warnings.

In the Thread 1 participant
  1. Simon Marchi proposer

    Proposes removing the unused `input_stream` variable from `mclex.c`, which causes build warnings.

    “Building binutils with a recent clang gives: /home/smarchi/src/binutils-gdb/binutils/mclex.c:42:17: warning: variable 'input_stream' set but not used [-Wunused-but-set-global] The variable has been unused since windmc was added. Only input_stream_pos is used to read the input. Remove it.”

In Details

This patch removes an unused global variable input_stream from binutils/mclex.c. This variable was intended to hold the input character stream for the lexer but has been obsolete since the windmc tool was introduced. The input_stream_pos variable is used instead for tracking the current position in the stream. Removing input_stream cleans up the code and resolves a compiler warning related to unused variables.

For Context
mclex.c
A C source file containing a lexer for parsing message compiler directives.
windmc
A tool likely related to the Windows Message Compiler, used in the binutils project.
input_stream_pos
A pointer likely used to track the current position within an input stream of characters.
Filed Under: cleanupbuildlexer