let mark_as_never_terminates kf =
let noreturn =
Cil.hasAttribute "noreturn" (Kernel_function.get_vi kf).vattr
in
try
if not (Never_Terminates.find kf || noreturn) then
(* Function marked with "terminates" and has no attribute "noreturn" *)
CilE.warn_once "one non terminating branch in function %a"
Kernel_function.pretty_name kf
with Not_found ->
(* Function never marked *)
if not noreturn then
CilE.warn_once "non termination detected in function %a"
Kernel_function.pretty_name kf;
Never_Terminates.add kf true