C++ function-like casts are not implemented in the gdb expression parser: (gdb) set lang c++ (gdb) print double(7) A syntax error in expression, near `7)'.
This missing functionality causes trouble when evaluating GCC predefined macros like __DBL_MAX__. For example, in GNU gdb (GDB) Fedora 7.12.1-47.fc25: (gdb) p __DBL_MAX__ A syntax error in expression, near `1.79769313486231570815e+308L)'. (gdb) info macro __DBL_MAX__ Defined at /ssd/src/gcc/79800/gcc/gimple-fold.c:0 -D__DBL_MAX__=double(1.79769313486231570815e+308L)
We should obviously fix that, but I thought I'd mention the workaround for folks that come here after running into this: (gdb) macro define __DBL_MAX__ ((double)1.79769313486231570815e+308L) I.e., redefine the macro to something that gdb understands. Evaluating expressions that involve __DBL_MAX__ will now use GDB's definition instead of the originally compiled in one.