GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/cobol

Eliminate unused function warning from COBOL parser.

The COBOL frontend no longer builds an unused internal helper function, preventing compiler warnings or errors.

This commit removes the hex_of function from the COBOL frontend’s move.cc file. The function was not being called, leading to an “unused function” warning or error during compilation. Eliminating the function simplifies the code and avoids unnecessary build-time issues.

In Details

The hex_of function is an intrinsic function in GNU COBOL, typically used to convert data items to their hexadecimal string representation. In this specific context within move.cc, the internal parser_move function previously contained commented-out calls to hex_of. This patch ensures that the internal compiler-specific hex_of implementation is not even compiled if not used, which is a common practice to keep build artefacts clean.

For Context

Compilers like GCC often have different parts, called 'frontends,' that understand various programming languages. This change is in the COBOL frontend, which allows GCC to compile COBOL code. Inside the compiler, there are helper functions that perform specific tasks. This commit addresses a situation where a helper function, designed to handle hexadecimal conversions, was present but never actually used by the COBOL parser. When a compiler finds code that isn't used, it can issue a warning or even stop the compilation, so removing the unused function prevents these build problems.

Filed Under: cobolbuild systemwarnings