C++FILT(1)

✨ c++filt β€” it's from the GNU Development Tools besties ✨

okay so picture this: you're staring at a wall of assembler and it's giving _Z1fv and you're like ??? bestie what does that MEAN. enter c++filt, the demangler of C++ and Java symbols, literally the translator you needed. let's go πŸ’…


🌸 NAME 🌸

c++filt β€” demangle C++ and Java symbols πŸ¦‹


πŸŽ€ 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 C++ and Java both do this thing called function overloading, which means you can have a million functions with the same name as long as each one takes parameters of different types. iconic behaviour honestly. but to tell those same-named functions apart, C++ and Java encode each one into a low-level assembler name that uniquely identifies that exact version. that process is called mangling. and c++filt does the inverse mapping: it decodes β€” demangles β€” low-level names back into user-level names so you can actually read them. πŸ‘‘

every alphanumeric word in the input (letters, digits, underscores, dollars, or periods, that whole squad) 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, the original word just goes straight through, no drama. which means you can yeet an entire assembler source file full of mangled names through c++filt and get the same file back with demangled names. slay.

you can also just decode individual symbols by handing them over on the command line:

c++filt <symbol>

if you give it no symbol arguments, c++filt reads symbol names from standard input instead. all results go to standard output. now here's the tea β˜• β€” the difference between command-line names and stdin names is that command-line arguments are expected to be just mangled names, and no checking happens to separate them from surrounding text. so for example:

c++filt -n _Z1fv

works and demangles to "f()", whereas:

c++filt -n _Z1fv,

does not work. (side eye to that extra comma at the end of the mangled name making it invalid πŸ™ˆ) this one however does work:

echo _Z1fv, | c++filt -n

and displays "f()," β€” the demangled name followed by that trailing comma, bestie. why? because when names come from standard input it's assumed they might be part of an assembler source file where there might be extra, extraneous characters trailing after a mangled name. like:

    .type   _Z1fv, @function

✨ 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. whether c++filt removes it by default is target dependent, iykyk.
  • -n, --no-strip-underscore β€” do not remove the initial underscore. leave it alone, it's thriving.
  • -p, --no-params β€” when demangling a function's name, don't show the types of the function's parameters. less is more sometimes.
  • -t, --types β€” attempt to demangle types as well as function names. this is disabled by default because 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". chaos.
  • -i, --no-verbose β€” don't include implementation details (if any) in the demangled output.
  • -r, -R, --recurse-limit, --no-recurse-limit, --recursion-limit, --no-recursion-limit β€” enables or disables a limit on the amount of recursion performed while demangling strings. since the name mangling formats allow for an infinite level of recursion, it's possible to create strings whose decoding will exhaust the stack space available on the host machine, triggering 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. 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. no cap.

the -r option is a synonym for the --no-recurse-limit option. the -R option is a synonym for the --recurse-limit option.

  • -s format, --format=format β€” c++filt can 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 to c++filt and exit 🫢
  • --version β€” print the version number of c++filt and exit.
  • @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. πŸŒ€


🌈 FOOTNOTES 🌈

  1. MS-DOS does not allow "+" characters in file names, so on MS-DOS this program is named CXXFILT. (silly little legacy era behaviour, we respect it πŸ™ˆ)

πŸ‘‘ SEE ALSO πŸ‘‘

the Info entries for binutils.


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".


okay bestie that's the whole page, you're officially demangle-pilled πŸ’– this was binutils-2.47, dated 2026-09-19 β€” go read some assembler and feel powerful, periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from