Changes between Version 23 and Version 24 of CodeStyle


Ignore:
Timestamp:
11/16/17 15:10:36 (7 years ago)
Author:
j.ca
Comment:

Tweak previous

Legend:

Unmodified
Added
Removed
Modified
  • CodeStyle

    v23 v24  
    8383== Printing time_t values ==
    8484
    85 POSIX specifies that time_t is an integer type but does not specify its size.  The underlying type might be "int", "long" or "long long", some might make it unsigned too.  This makes it hard to portably print time_t values using printf-like APIs, as a mismatch between the format string and the actual time_t size can lead to crashes or bogus representations. The safest way is to print those values as long long, which is at least 64 bits wide.
    86 
     85POSIX specifies that time_t is an integer type but does not specify its size.  The underlying type might be "int", "long" or "long long", some systems might make it unsigned too.  This makes it hard to portably print time_t values using printf-like APIs, as a mismatch between the format string and the actual time_t size can lead to crashes or bogus representations. The safest way is to print time_t values as long long, which is at least 64 bits wide:
    8786{{{#!c
    8887time_t now = time(NULL);