#This script is designed to run with Understand - CodeCheck use base ("Understand::Codecheck"); use strict; use constant ERR1 => ' included in file %1'; sub register_tr_text() { my $check = shift; $check->add_tr_text(ERR1); } sub name { return "20.8 The signal handling facilities of shall not be used";} sub description { return "20.8 (Required) The signal handling facilities of shall not be used";} sub detailed_description { return <<"END_DESC" Signal handling contains implementation-defined and undefined behaviour. END_DESC } sub test_language { my $language = shift; return $language =~ /C\+\+/; #Handles C and C++ } sub test_entity { return 1;} sub test_global { return 0;} sub define_options{} sub check { my $check = shift; my $file = shift; return unless $file->kind->check("file ~unknown ~unresolved"); foreach my $includes($file->filerefs("include","file")){ if($includes->ent->name eq "signal.h"){ $check->violation($includes->ent,$file,$includes->line,$includes->column,ERR1,$file->name); } } }