C++FILT(1)
π C++FILT(1) β GNU Development Tools π
okay bestie, welcome to the group chat for c++filt, straight out of the GNU Development Tools manual. pull up a chair, grab a boba, we're decoding cryptic assembler soup into names that actually β¨mean somethingβ¨.
πΈ NAME πΈ
c++filt β demangle C++ and Java symbols. that's it, that's the whole job, and she does it gorgeously π
π¦ 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...]
like yes she's a lot of options but she's worth it, i promise π«Ά
β¨ DESCRIPTION β¨
okay so here's the lore π β C++ and Java both do this thing called function overloading, which means you can write a million functions with the literal same name as long as each one takes parameters of different types. iconic behavior honestly.
but the compiler can't just leave them all called the same thing, right? so C++ and Java encode each one into a low-level assembler name that uniquely identifies that specific version. that process? it's called mangling. cursed name, i know π
c++filt does the inverse mapping β she decodes (demangles) those low-level names back into user-level names so us humans can actually read them. she's literally the translator of the friend group π
So every alphanumeric word you throw at her β and alphanumeric here means letters, digits, underscores, dollars, or periods β is a potential mangled name. if the name decodes into a C++ name, the C++ name replaces the low-level name in the output. if it doesn't decode, she just outputs the original word, no drama, no notes π
which means you can pipe an entire assembler source file full of mangled names through c++filt and get the same source file back with demangled names. main character energy fr fr π
You can also use her to decipher individual symbols by handing them over on the command line:
c++filt <symbol>
If you give her no symbol arguments at all, c++filt reads symbol names from the standard input instead. all the results get printed on the standard output, as one does π
now the tea β β the difference between reading names from the command line vs. from stdin: command-line arguments are expected to be just mangled names, and no checking is performed to separate them from surrounding text. so for example:
c++filt -n _Z1fv
will work and demangle the name to "f()" whereas:
c++filt -n _Z1fv,
will 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 will display "f()," β i.e., the demangled name followed by a trailing comma. why? because when names are read from the standard input it's expected that they might be part of an assembler source file, where there might be extra, extraneous characters trailing after a mangled name. for example:
.type _Z1fv, @function
see? context matters bestie π§
π OPTIONS π
-_,--strip-underscoreβ on some systems, both the C and C++ compilers slap an underscore in front of every name. like, 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 β so it depends on your setup, no cap.-n,--no-strip-underscoreβ do not remove the initial underscore. hands off, she keeps it π-p,--no-paramsβ when demangling the name of a function, don't display the types of the function's parameters. minimalism, she's serving looks.-t,--typesβ attempt 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 get confused with non-mangled names π΅βπ« for example, a function called"a"treated as a mangled type name would be demangled to"signed char". so likeβ¦ be careful with this one.-i,--no-verboseβ do not include implementation details (if any) in the demangled output. she keeps it cute and clean β¨-r,-R,--recurse-limit,--no-recurse-limit,--recursion-limit,--no-recursion-limitβ enables or disables a limit on the amount of recursion performed whilst demangling strings. and listen β since the name mangling formats allow for an infinite level of recursion, it's possible to create strings whose decoding will exhaust the amount of stack space available on the host machine, triggering a memory fault ππ the limit tries to prevent this from happening 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. note however that if the recursion limit is disabled then stack exhaustion is possible and any bug reports about such an event will be rejected π« β like, they will literally say "we told you so."
the -r option is a synonym for the --no-recurse-limit option. the -R option is a synonym for the --recurse-limit option. iykyk π
-s format,--format=formatβc++filtcan decode various methods of mangling, used by different compilers. the argument to this option selects which method she 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. she's helpful like that πββοΈ--versionβ print the version number ofc++filtand exit. name drop, periodt π@fileβ read command-line options from file. the options read are inserted in place of the original@fileoption. if file does not exist, or cannot be read, then the option will be treated literally, and not removed. sneaky but iconic.
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 giving inception π
π FOOTNOTES π
- MS-DOS does not allow
"+"characters in file names, so on MS-DOS this program is namedCXXFILT. history lesson bestie, cherish it π
π SEE ALSO π
the Info entries for binutils. go read them, they're giving lore expansion π
π 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 was binutils-2.47, dated 2026-08-26 β she may be from the future but her demangling is timeless π
β¨ bye cutie, go demangle something π
π¦ where this page comes from
- arch rolling: loongarch64-linux-gnu-binutils 2.47-1 Β· GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later AND FSFAP
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms