Skip to content
Snippets Groups Projects

Fix build with GLib 2.81.x and glibc 2.39

Merged Simon McVittie requested to merge wip/smcv/qsort into main
  1. Aug 13, 2024
    • Simon McVittie's avatar
      build: Don't warn for redundant declarations · bb8c172d
      Simon McVittie authored
      
      Redundant declarations are explicitly allowed in C11, and glibc 2.39's
      implementation of `_Static_assert` uses them, so we need to avoid failing
      on these in order to build successfully on Debian 13 prereleases.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      bb8c172d
    • Simon McVittie's avatar
      Avoid deprecated g_qsort_with_data() · 45ed2aad
      Simon McVittie authored
      
      For historical reasons g_qsort_with_data() "only" works with up to 2**31
      items, so it won't necessarily work for pathologically large arrays
      and therefore is deprecated.
      
      The advantage of g_qsort_with_data() and its replacement g_sort_array()
      is that GLib guarantees that they are a stable sort (will not permute
      items that already compare equal), which is not a guarantee for glibc's
      qsort() and qsort_r(). However, in each of these places we are sorting
      the keys from a hash table, which are unique anyway, so there is no
      advantage to a stable sort.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      45ed2aad
Loading