I've been extending -fopt-info to cover inlining, and I added a %S format code to dump_printf which accepts a symtab_node *.
Unfortunately, -Wformat doesn't like the fact that I'm passing in a subclass pointer (cgraph_node *), e.g.: ipa-inline.c: In function ‘unsigned int early_inliner(function*)’: ipa-inline.c:2769:21: error: format ‘%S’ expects argument of type ‘symtab_node*’, but argument 3 has type ‘cgraph_node*’ [-Werror=format=] 2769 | "Flattening %S\n", node); | ~^ ~~~~ | | | | | cgraph_node* | symtab_node* I could fix this by changing my format converter so that explicitly takes a cgraph_node *, but I wondered if it would be better to instead teach -Wformat to accept non-virtual subclass pointers, so that %S can handle symtab_node * and its two subclasses. Does this sound sane, and is there a conversion function I can call for this case? cp_convert_to_pointer seemed the closest match. Thanks Dave