Skip to content

Commit

Permalink
Fix bugs in -Wcast-qual pacification
Browse files Browse the repository at this point in the history
Reset to iana-tz 4ab8692704842adee814a1c06c20e3bdb5d02574
  • Loading branch information
jodastephen committed Jan 15, 2025
1 parent 2d0e54b commit 1e08c9a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions localtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,13 @@ static int lock(void) { return 0; }
static void unlock(void) { }
#endif

/* Convert to TYPE the value of the expression EXPR. Use C99+ implicit
conversion if available, as it is less powerful and therefore safer. */
#if PORT_TO_C89
# define TYPECVT(type, expr) ((type) (expr))
#else
# define TYPECVT(type, expr) ((type) {expr})
#endif

/* Unless intptr_t is missing, pacify gcc -Wcast-qual on char const * exprs.
Use this carefully, as the casts disable type checking.
This is a macro so that it can be used in static initializers. */
#ifdef INTPTR_MAX
# define UNCONST(a) ((char *) (intptr_t) TYPECVT (char const *, a))
# define UNCONST(a) ((char *) (intptr_t) (a))
#else
# define UNCONST(a) TYPECVT (char const *, a)
# define UNCONST(a) ((char *) (a))
#endif

/* A signed type wider than int, so that we can add 1900 + tm_mon/12 to tm_year
Expand Down

0 comments on commit 1e08c9a

Please # to comment.