"Fossies" - the Fresh Open Source Software Archive

Member "cppcheck-1.89/addons/test/y2038/y2038-test-1-bad-time-bits.c" (1 Sep 2019, 298 Bytes) of package /windows/misc/cppcheck-1.89.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <stdio.h>
    2 #include <fcntl.h>
    3 
    4 /*
    5  * Define _TIME_BITS unequal to 64 to trigger error
    6  */
    7 
    8 #define _TIME_BITS 62
    9 
   10 #include "y2038-inc.h"
   11 
   12 int main(int argc, char **argv)
   13 {
   14     clockid_t my_clk_id = CLOCK_REALTIME;
   15     struct timespec *my_tp;
   16 
   17     return clock_gettime(my_clk_id, &my_tp);
   18 }