[RFA 1/3] Use function_name_style to print Ada and C function names

Tom Tromey tom@tromey.com
Sat Jan 12 22:59:00 GMT 2019


>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> ada-typeprint.c:print_func_type is only called to print types that are
Philippe> functions.  So, that effectively prints a function name.

No opinion on that one, maybe Joel could say.

Philippe> c-typeprint.c (c_print_type_1) is effectively called to print whatever
Philippe> type (so not only functions), but the following added condition
Philippe> should ensure function name style is only used for function names:
Philippe> -      fputs_filtered (varstring, stream);
Philippe> +      if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
Philippe> +       fputs_styled (varstring, function_name_style.style (), stream );
Philippe> +      else
Philippe> +       fputs_filtered (varstring, stream);

Actually here I wonder if this can be hit.
Maybe
    typedef void Typename ();
... ?  But I'd sort of expect not.

Tom



More information about the Gdb-patches mailing list