binutils Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
binutils

Fixes strrchr Error for DOS Based Filesystem

Fixes a type error when using strrchr on DOS-based filesystems by ensuring the result is assigned to a const char *.

This commit fixes an error related to the use of strrchr on DOS-based filesystems. The code now ensures that the result of strrchr is assigned to a const char *, preventing a discarded-qualifiers warning. This change affects bucomm.c and gprof/source.c.

In Details

This commit addresses a const qualifier issue when using strrchr in binutils and gprof. Specifically, when dealing with DOS-based file systems, the result of strrchr (which returns a pointer to a character within a const char *) was being assigned to a non-const char *, leading to a discarded-qualifiers warning. The interaction with DOS filesystem handling is the key here.

For Context

Binutils is a collection of binary tools, including the linker, assembler, and other utilities for working with object files and executables. DOS-based file systems use a backslash (\) as a path separator, while Unix-like systems use a forward slash (/). This commit ensures correct handling of path separators when profiling or processing binaries on DOS-based systems, avoiding type errors in the code.

Filed Under: binutilsgprofbugfixdos