C++FILT(1)
π c++filt β GNU Development Tools, bestie edition
okay so you're looking at the c++filt(1) page from the GNU Development Tools set, and honestly? it's a glow-up for your terminal. let's get into it π
β¨ NAME β¨
c++filt β demangle C++ and Java symbols
like, it takes the cursed low-level names and makes them readable again. main character energy fr π«Ά
π SYNOPSIS π
c++filt [-_|--strip-underscore]
[-n|--no-strip-underscore]
[-p|--no-params]
[-t|--types]
[-i|--no-verbose]
[-r|--no-recurse-limit]
[-R|--recurse-limit]
[-s format|--format=format]
[--help] [--version] [symbol...]
π¦ DESCRIPTION π¦
so here's the tea β β C++ and Java both do this thing called function overloading, which means you can write a million functions with the same name as long as each one takes parameters of different types. iconic, honestly. but to tell all those same-named functions apart, C++ and Java encode them into a low-level assembler name that uniquely IDs each different version. that whole process is called mangling (yes, that's the real word, i'm not being dramatic).
the c++filt [1] program does the inverse: it decodes (demangles) those low-level names back into user-level names so actual humans can read them. it's giving translator bestie π
every alphanumeric word you see in the input β meaning letters, digits, underscores, dollars, or periods β is a potential mangled name. if the name decodes into a C++ name, then boom, the C++ name replaces the low-level name in the output. if it doesn't decode? the original word just gets output as-is. no harm, no foul. so you can literally pipe a whole entire assembler source file full of mangled names through c++filt and get the same source file back with demangled names. obsessed π
you can also use c++filt to decipher individual symbols by passing them right on the command line:
c++filt <symbol>
if you don't give it any symbol arguments, c++filt reads symbol names from the standard input instead. all the results go to the standard output. β¨
now, the difference between command line vs stdin is lowkey important:
- command-line arguments are expected to be just mangled names, and no checking is performed to separate them from surrounding text.
- stdin names get the benefit of the doubt β they're expected to maybe be part of an assembler source file where there might be extra, extraneous characters trailing after a mangled name.
so for example, this:
c++filt -n _Z1fv
works and demangles the name to "f()". but this:
c++filt -n _Z1fv,
does not work. (note the extra comma at the end of the mangled name which makes it invalid π). this command however will work:
echo _Z1fv, | c++filt -n
and it displays "f()," β the demangled name followed by a trailing comma. see how that works? because when names come from stdin, c++filt assumes they might be chilling inside an assembler source file with extra characters hanging around. like this:
.type _Z1fv, @function
π OPTIONS π
-_,--strip-underscoreβ on some systems, both the C and C++ compilers slap an underscore in front of every name. for example, the C name"foo"gets the low-level name"_foo". this option removes that initial underscore. whetherc++filtremoves the underscore by default is target dependent (iykyk, it depends on your system).-n,--no-strip-underscoreβ do not remove the initial underscore. that's it, that's the whole vibe.-p,--no-paramsβ when demangling the name of a function, don't display the types of the function's parameters. less info, cleaner look β¨-t,--typesβ try to demangle types as well as function names. this is disabled by default since mangled types are normally only used internally in the compiler, and they can be confused with non-mangled names. for example, a function called"a"treated as a mangled type name would be demangled to"signed char". yeah. chaotic. π-i,--no-verboseβ do not include implementation details (if any) in the demangled output. keep it cute, keep it minimal.-r,-R,--recurse-limit,--no-recurse-limit,--recursion-limit,--no-recursion-limitβ enables or disables a limit on how much recursion happens while demangling strings. ok so here's why this matters: the name mangling formats allow for infinite levels of recursion, which means somebody could create strings whose decoding will exhaust the stack space available on the host machine and trigger a memory fault. the limit tries to prevent that by restricting recursion to 2048 levels of nesting. π
the default is for this limit to be enabled, but disabling it may be necessary in order to demangle truly complicated names. but heads up β if the recursion limit is disabled, then stack exhaustion is possible, and any bug reports about such an event will be rejected. read that again. π
also: the -r option is a synonym for the --no-recurse-limit option, and the -R option is a synonym for the --recurse-limit option. (yes, lowercase = no limit, uppercase = limit. don't ask me, i don't make the rules.)
-sformat,--format=*format*βc++filtcan decode various methods of mangling, used by different compilers. the argument to this option selects which method it uses: π―"auto"β automatic selection based on executable (the default method)"gnu"β the one used by the GNU C++ compiler (g++)"lucid"β the one used by the Lucid compiler (lcc)"arm"β the one specified by the C++ Annotated Reference Manual"hp"β the one used by the HP compiler (aCC)"edg"β the one used by the EDG compiler"gnu-v3"β the one used by the GNU C++ compiler (g++) with the V3 ABI"java"β the one used by the GNU Java compiler (gcj)"gnat"β the one used by the GNU Ada compiler (GNAT)
--helpβ print a summary of the options toc++filtand exit. bestie behaviour fr π«Ά--versionβ print the version number ofc++filtand exit. slay.@file β read command-line options from file. the options read are inserted in place of the original@file option. if file does not exist, or cannot be read, then the option will be treated literally, and not removed. π
options in file are separated by whitespace. a whitespace character may be included in an option by surrounding the entire option in either single or double quotes. any character (including a backslash) may be included by prefixing the character to be included with a backslash. the file may itself contain additional @file options; any such options will be processed recursively. it's files all the way down π
πΈ FOOTNOTES πΈ
- MS-DOS does not allow
"+"characters in file names, so on MS-DOS this program is namedCXXFILT. vintage tech problems, honestly π
π SEE ALSO π
the Info entries for binutils. go read them, they're right there π
π COPYRIGHT π
Copyright (c) 1991-2026 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
and that's the whole page, bestie π this one's from binutils-2.47, dated 2026-07-30 β go demangle something iconic today, you've earned it πβ¨
π¦ where this page comes from
- arch rolling: aarch64-linux-gnu-binutils 2.47-1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms