Skip to content
Snippets Groups Projects
  • mio's avatar
    8b58ecdd
    community/telepathy-logger: fix build with gcc 14 on 32-bit arches · 8b58ecdd
    mio authored
    Fix -Wincompatible-pointer-types error with gcc 14 on 32-bit arches.
    
    ```
    telepathy-logger.c: In function 'log_handler':
    telepathy-logger.c:70:20: error: passing argument 1 of 'localtime_r' from incompatible pointer type [-Wincompatible-pointer-types]
       70 |       localtime_r (&(now.tv_sec), &tm);
          |                    ^~~~~~~~~~~~~
          |                    |
          |                    glong * {aka long int *}
    In file included from /usr/include/glib-2.0/glib/gtypes.h:41,
                     from /usr/include/glib-2.0/glib/galloca.h:34,
                     from /usr/include/glib-2.0/glib.h:32,
                     from telepathy-logger.c:23:
    /usr/include/time.h:76:25: note: expected 'const time_t * restrict' {aka 'const long long int * restrict'} but argument is of type 'glong *' {aka 'long int *'}
       76 | struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
          |                         ^
    ```
    8b58ecdd
    History
    community/telepathy-logger: fix build with gcc 14 on 32-bit arches
    mio authored
    Fix -Wincompatible-pointer-types error with gcc 14 on 32-bit arches.
    
    ```
    telepathy-logger.c: In function 'log_handler':
    telepathy-logger.c:70:20: error: passing argument 1 of 'localtime_r' from incompatible pointer type [-Wincompatible-pointer-types]
       70 |       localtime_r (&(now.tv_sec), &tm);
          |                    ^~~~~~~~~~~~~
          |                    |
          |                    glong * {aka long int *}
    In file included from /usr/include/glib-2.0/glib/gtypes.h:41,
                     from /usr/include/glib-2.0/glib/galloca.h:34,
                     from /usr/include/glib-2.0/glib.h:32,
                     from telepathy-logger.c:23:
    /usr/include/time.h:76:25: note: expected 'const time_t * restrict' {aka 'const long long int * restrict'} but argument is of type 'glong *' {aka 'long int *'}
       76 | struct tm *localtime_r (const time_t *__restrict, struct tm *__restrict);
          |                         ^
    ```