[committed] ipa-devirt: make qsort helpers static

Message ID alpine.LNX.2.20.13.1907312050230.2327@monopod.intra.ispras.ru
State New
Headers show
Series
  • [committed] ipa-devirt: make qsort helpers static
Related show

Commit Message

Alexander Monakov July 31, 2019, 5:56 p.m.
Hi,

noticed this when checking a qsort patch, applying as obvious.

In the C days, -Wmissing-prototypes would have caught this, but C++ needs a
different warning (-Wmissing-declarations), so we get inevitable bitrot :/

Alexander

        * ipa-devirt.c (type_warning_cmp): Make static.
        (decl_warning_cmp): Ditto.

Patch

--- a/gcc/ipa-devirt.c
+++ b/gcc/ipa-devirt.c
@@ -3526,7 +3526,7 @@  likely_target_p (struct cgraph_node *n)
 /* Compare type warning records P1 and P2 and choose one with larger count;
    helper for qsort.  */

-int
+static int
 type_warning_cmp (const void *p1, const void *p2)
 {
   const odr_type_warn_count *t1 = (const odr_type_warn_count *)p1;
@@ -3542,7 +3542,7 @@  type_warning_cmp (const void *p1, const void *p2)
 /* Compare decl warning records P1 and P2 and choose one with larger count;
    helper for qsort.  */

-int
+static int
 decl_warning_cmp (const void *p1, const void *p2)
 {
   const decl_warn_count *t1 = *(const decl_warn_count * const *)p1;