@@ -285,9 +285,11 @@ void remove_function_pointerst::remove_function_pointer(
285285 const exprt &pointer=function.op0 ();
286286 remove_const_function_pointerst::functionst functions;
287287 does_remove_constt const_removal_check (goto_program, ns);
288- if (const_removal_check ())
288+ const auto does_remove_const = const_removal_check ();
289+ if (does_remove_const.first )
289290 {
290- warning () << " Cast from const to non-const pointer found, only worst case"
291+ warning ().source_location = does_remove_const.second ;
292+ warning () << " cast from const to non-const pointer found, only worst case"
291293 << " function pointer removal will be done." << eom;
292294 found_functions=false ;
293295 }
@@ -341,10 +343,8 @@ void remove_function_pointerst::remove_function_pointer(
341343 if (t.first ==" pthread_mutex_cleanup" )
342344 continue ;
343345
344- symbol_exprt expr;
345- expr.type ()=t.second ;
346- expr.set_identifier (t.first );
347- functions.insert (expr);
346+ symbol_exprt expr (t.first , t.second );
347+ functions.insert (expr);
348348 }
349349 }
350350
@@ -430,6 +430,25 @@ void remove_function_pointerst::remove_function_pointer(
430430 statistics ().source_location =target->source_location ;
431431 statistics () << " replacing function pointer by "
432432 << functions.size () << " possible targets" << eom;
433+
434+ // list the names of functions when verbosity is at debug level
435+ conditional_output (
436+ debug (),
437+ [this , &functions](mstreamt &mstream) {
438+ mstream << " targets: " ;
439+
440+ bool first = true ;
441+ for (const auto &function : functions)
442+ {
443+ if (!first)
444+ mstream << " , " ;
445+
446+ mstream << function.get_identifier ();
447+ first = false ;
448+ }
449+
450+ mstream << eom;
451+ });
433452}
434453
435454bool remove_function_pointerst::remove_function_pointers (
0 commit comments