src/test/SDL_test_log.c
changeset 10396 fa4e35434a9c
parent 9998 f67cf37e9cd4
child 10397 3126026a822b
equal deleted inserted replaced
10395:99bdc4fc41ba 10396:fa4e35434a9c
    48  *
    48  *
    49  * \param timestamp A Timestamp, i.e. time(0)
    49  * \param timestamp A Timestamp, i.e. time(0)
    50  *
    50  *
    51  * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02'
    51  * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02'
    52  */
    52  */
       
    53 #pragma GCC diagnostic push
       
    54 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
    53 char *SDLTest_TimestampToString(const time_t timestamp)
    55 char *SDLTest_TimestampToString(const time_t timestamp)
    54 {
    56 {
    55     time_t copy;
    57     time_t copy;
    56     static char buffer[64];
    58     static char buffer[64];
    57     struct tm *local;
    59     struct tm *local;
    62     local = localtime(&copy);
    64     local = localtime(&copy);
    63     strftime(buffer, sizeof(buffer), fmt, local);
    65     strftime(buffer, sizeof(buffer), fmt, local);
    64 
    66 
    65     return buffer;
    67     return buffer;
    66 }
    68 }
       
    69 #pragma GCC diagnostic pop
    67 
    70 
    68 /*
    71 /*
    69  * Prints given message with a timestamp in the TEST category and INFO priority.
    72  * Prints given message with a timestamp in the TEST category and INFO priority.
    70  */
    73  */
    71 void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
    74 void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)