binutils Newspaper
NOVEMBER 30, 2026
binutils/windmc — Proposed

binutils/windmc: remove unused mcset_use_hresult variable

Remove unused `mcset_use_hresult` variable from binutils/windmc.c.

Simon Marchi proposes removing the mcset_use_hresult variable from binutils/windmc.c. This variable is set by the -o option, which is not implemented and immediately calls fatal. Therefore, the variable is never actually used and causes a build warning with recent Clang versions.

In the Thread 1 participant
  1. Simon Marchi proposer

    Proposes removing the unused `mcset_use_hresult` variable from `windmc.c`, which causes build errors.

    “Building binutils with a recent clang fails with: /home/smarchi/src/binutils-gdb/binutils/windmc.c:116:12: error: variable 'mcset_use_hresult' set but not used [-Werror,-Wunused-but-set-global] The -o option that sets it was never implemented, it errors out right after setting the variable. Remove the variable.”

In Details

This patch removes an unused global variable mcset_use_hresult from binutils/windmc.c. This variable was intended to be set by the -o option, which is designed to generate an OLE2 header file using HRESULT definitions. However, the -o option itself is unimplemented and immediately exits via fatal(). Consequently, mcset_use_hresult is always set but never used, leading to a compiler warning.

For Context
windmc.c
C source file for the Windows Message Compiler utility in binutils.
mcset_use_hresult
A flag intended to control the generation of OLE2 header files using HRESULT definitions.
OLE2
Object Linking and Embedding version 2, a Microsoft technology for inter-process communication and data sharing.
HRESULT
A data type used in Windows for error codes, typically returned by COM (Component Object Model) interfaces.
Filed Under: cleanupbuildunimplemented