[RFA 3/3] Special case NULL when using printf's %s format

Tom Tromey tom@tromey.com
Fri Feb 16 21:58:00 GMT 2018


Pedro> Then again, I don't think it's likely that programs map
Pedro> strings at 0 (I think it's more like interrupt vectors), so for %s,
Pedro> it's likely that nobody would miss printing 0 as a string.

Another option would be to do a try-catch and only print "(null)" on
failure, if the pointer is 0.

Tom



More information about the Gdb-patches mailing list