[previous] MISRA-C:2004  Rule  20.12:  (Required) [next] The time handling functions of library <time.h> shall not be used.
Includes time, strftime. This library is associated with clock times. Various aspects are implementation dependent or unspecified, such as the formats of times. If any of the facilities of time.h are used then the exact implementation for the compiler being used must be determined, and a deviation raised.

Example Code:


#include <time.h>                          /* MISRA Violation */

#include "misra.h"
#include "m2cmex.h"

extern S16 test_2012( void )
{
  S16    r = 0;
  time_t xtime;
  
  if ( time( &xtime ) == ( time_t )-1 )    /* MISRA Violation */
  {
      r = -1;
  }

  return r;
}


QAC messages that encompass this guideline:

5127 The time handling functions of library <time.h> shall not be used.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents