#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 "18-0-4 The time handling functions of library shall not be used";} sub description { return "18-0-4 (Required) The time handling functions of library shall not be used";} sub detailed_description { return <<"END_DESC"

Rationale Various aspects are implementation-defined or unspecified, such as the formats of times.

Example
#include  
void f ( ) 
{ 
   clock ( );         // Non-compliant 
} 
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 "ctime"){ $check->violation($includes->ent,$file,$includes->line,$includes->column,ERR1,$file->name); } } }