Comment on Flint 3.3.1 package

8 views
Skip to first unread message

American Citizen

unread,
Nov 4, 2025, 1:22:24 AM (2 days ago) Nov 4
to flint-devel
Please do NOT take this as a critical comment. Nearly all of the 5,006 C module files compiled without a warning.

I am listing the warnings which did come up, so that this can also be fixed.

I found some compiler warnings issued while doing a gcc14 compile to the Flint 3.3.1 package.

The current gmp being used is:

gmp v6.3.0 build options:

  Version:           GNU MP 6.3.0
  Host type:         ivybridge-pc-linux-gnu
  ABI:               64
  Install prefix:    /usr/local
  Compiler:          /usr/bin/gcc-13
  Static libraries:  yes
  Shared libraries:  yes

I had to turn off the enable gmp-internals, because the gmp library is missing the appropriate subdirectory for the ivybridge configuration (missing file path)

So I ran "./configure --disable-gmp-internals" which was successful to completion.

While running "make" on Flint v3.3.1 the following gcc-13 compiler warnings were issued:

  CC  mpn_extras/sqrhigh_basecase.c
/home/owner/math/flint-3.3.1/src/mpn_extras/sqrhigh_basecase.c: In function ‘flint_mpn_sqrhigh_2’:
/home/owner/math/flint-3.3.1/src/mpn_extras/sqrhigh_basecase.c:46:15: warning: variable ‘b’ set but not used [-Wunused-but-set-variable]
   46 |     mp_limb_t b, low;
      |               ^
----------------------------------------------------------------------------------------------------------------------
  CC  mpn_extras/mulhigh_recursive.c
In file included from /home/owner/math/flint-3.3.1/src/mpn_extras/mulhigh_recursive.c:13:
In function ‘flint_mpn_mul’,
    inlined from ‘_flint_mpn_mulhigh_n_recursive’ at /home/owner/math/flint-3.3.1/src/mpn_extras/mulhigh_recursive.c:69:13:
/home/owner/math/flint-3.3.1/src/mpn_extras.h:498:76: warning: array subscript 16 is above array bounds of ‘mp_limb_t (* const[8])(mp_limb_t *, const mp_limb_t *, const mp_limb_t *)’ {aka ‘long unsigned int (* const[8])(long unsigned int *, const long unsigned int *, const long unsigned int *)’} [-Warray-bounds=]
  498 | # define FLINT_MPN_MUL_HARD(rp, xp, xn, yp, yn) (flint_mpn_mul_func_tab[xn][yn](rp, xp, yp))
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/owner/math/flint-3.3.1/src/mpn_extras.h:534:16: note: in expansion of macro ‘FLINT_MPN_MUL_HARD’
  534 |         return FLINT_MPN_MUL_HARD(r, x, xn, y, yn);
      |                ^~~~~~~~~~~~~~~~~~
/home/owner/math/flint-3.3.1/src/mpn_extras.h: In function ‘_flint_mpn_mulhigh_n_recursive’:
/home/owner/math/flint-3.3.1/src/mpn_extras.h:512:45: note: while referencing ‘flint_mpn_mul_func_tab’
  512 | FLINT_DLL extern const flint_mpn_mul_func_t flint_mpn_mul_func_tab[][FLINT_MPN_MUL_FUNC_TAB_WIDTH];
      |                                             ^~~~~~~~~~~~~~~~~~~~~~

----------------------------------------------------------------------------------------------------------------------
  CC  mpn_extras/mulhigh_basecase.c
/home/owner/math/flint-3.3.1/src/mpn_extras/mulhigh_basecase.c: In function ‘flint_mpn_mulhigh_2’:
/home/owner/math/flint-3.3.1/src/mpn_extras/mulhigh_basecase.c:219:15: warning: variable ‘b’ set but not used [-Wunused-but-set-variable]
  219 |     mp_limb_t b, low;
      |               ^

----------------------------------------------------------------------------------------------------------------------
  CC  mpn_mod/poly_divrem_basecase.c
In function ‘_mpn_mod_poly_divrem_q1_preinv1’,
    inlined from ‘_mpn_mod_poly_divrem_basecase_preinv1’ at /home/owner/math/flint-3.3.1/src/mpn_mod/poly_divrem_basecase.c:179:16:
/home/owner/math/flint-3.3.1/src/mpn_mod/poly_divrem_basecase.c:85:5: warning: ‘q1’ may be used uninitialized [-Wmaybe-uninitialized]
   85 |     mpn_mod_mul(t, q1, B + (lenB - 2) * nlimbs, ctx);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/owner/math/flint-3.3.1/src/mpn_mod/poly_divrem_basecase.c:12:
/home/owner/math/flint-3.3.1/src/mpn_mod.h: In function ‘_mpn_mod_poly_divrem_basecase_preinv1’:
/home/owner/math/flint-3.3.1/src/mpn_mod.h:164:5: note: by argument 2 of type ‘nn_srcptr’ {aka ‘const long unsigned int *’} to ‘mpn_mod_mul’ declared here
  164 | int mpn_mod_mul(nn_ptr res, nn_srcptr x, nn_srcptr y, gr_ctx_t ctx);
      |     ^~~~~~~~~~~
/home/owner/math/flint-3.3.1/src/mpn_mod/poly_divrem_basecase.c:70:11: note: ‘q1’ declared here
   70 |     ulong q1[MPN_MOD_MAX_LIMBS];
      |           ^~

----------------------------------------------------------------------------------------------------------------------
  CC  acb_theta/ql_exact.c
In function ‘acb_theta_ql_exact_steps’,
    inlined from ‘acb_theta_ql_exact’ at /home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:602:9:
/home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:527:11: warning: ‘rts_all’ may be used uninitialized [-Wmaybe-uninitialized]
  527 |     res = acb_theta_ql_setup(rts, rts_all, t, &guard, easy_steps, zs, nb, tau, distances,
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  528 |         nb_steps, all, prec);
      |         ~~~~~~~~~~~~~~~~~~~~
/home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c: In function ‘acb_theta_ql_exact’:
/home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:509:30: note: ‘rts_all’ was declared here
  509 |     acb_ptr rts, th_init, t, rts_all;
      |                              ^~~~~~~
In function ‘acb_theta_ql_perform_steps’,
    inlined from ‘acb_theta_ql_exact_steps’ at /home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:543:9,
    inlined from ‘acb_theta_ql_exact’ at /home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:602:9:
/home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:428:17: warning: ‘aux’ may be used uninitialized [-Wmaybe-uninitialized]
  428 |                 acb_theta_agm_sqrt(aux, aux, rts_all + j * n * n, n * n, prec);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c: In function ‘acb_theta_ql_exact’:
/home/owner/math/flint-3.3.1/src/acb_theta/ql_exact.c:394:31: note: ‘aux’ was declared here
  394 |     acb_ptr th_next, th_temp, aux;
      |                               ^~~

----------------------------------------------------------------------------------------------------------------------
5,006 C files were compiled. Nearly all had NO warnings or errors. This is a tribute to the very high quality of the c code.

I do have a working flint 3.3.1 library now on my linux system.


Albin Ahlbäck

unread,
Nov 4, 2025, 6:23:25 AM (2 days ago) Nov 4
to flint...@googlegroups.com, American Citizen
Dear Randall,

I think the warnings should be more or less fixed. Apart from some
signed-unsigned comparisons (which very much can be a problem), I think
most warnings left can be ignored.

However, as for `mpn_gcd_11' missing, I'm unsure to why it fails. It
should be a part of your GMP. Can you please post the output of `nm
--defined-only libgmp.so | grep "mpn_gcd"' (assuming you are on Linux)?

Best,
Albin
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "flint-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to flint-devel...@googlegroups.com <mailto:flint-
> devel+un...@googlegroups.com>.
> To view this discussion, visit https://groups.google.com/d/msgid/flint-
> devel/970d154d-ca85-4db2-bfdf-4c428e2a6ffcn%40googlegroups.com <https://
> groups.google.com/d/msgid/flint-devel/970d154d-ca85-4db2-
> bfdf-4c428e2a6ffcn%40googlegroups.com?utm_medium=email&utm_source=footer>.

American Citizen

unread,
Nov 5, 2025, 5:27:55 PM (17 hours ago) Nov 5
to flint-devel
I did patch 4 files to fix the warnings. 2 were pragma fixes, 2 were initializing the pointers. 1 warning needs discussion and careful analysis.

Reply all
Reply to author
Forward
0 new messages