Fixed defects
List of Defects
Error: CLANG_WARNING: [#def1]
gmp-6.2.1/mpn/fib_table.c:4: included_from: Included from here.
gmp-6.2.1/gmp-impl.h:4187:10: warning[deadcode.DeadStores]: Although the value stored to 'bits' is used in the enclosing expression, the value is never actually read from 'bits'
# 4185| here, but at least on x86, that's no real saving.
# 4186| */
# 4187|-> return bits = jacobi_table[(bits << 3) + (denominator << 2) + q];
# 4188| }
# 4189|
Error: GCC_ANALYZER_WARNING (CWE-457): [#def2]
gmp-6.2.1/longlong.h:1062:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'rh'
gmp-6.2.1/mpn/generic/mod_1_3.c:146:3: note: in expansion of macro 'umul_ppmm'
gmp-6.2.1/mpn/generic/mod_1_3.c:146:3: note: in expansion of macro 'umul_ppmm'
gmp-6.2.1/mpn/generic/mod_1_3.c:146:3: note: in expansion of macro 'umul_ppmm'
# 1060| #else
# 1061| #define umul_ppmm(w1, w0, u, v) \
# 1062|-> __asm__ ("mulq\t%3" \
# 1063| : "=a" (w0), "=d" (w1) \
# 1064| : "%0" ((UDItype)(u)), "rm" ((UDItype)(v)))
Error: GCC_ANALYZER_WARNING (CWE-457): [#def3]
gmp-6.2.1/mpn/generic/mod_1_3.c:41: included_from: Included from here.
gmp-6.2.1/mpn/generic/mod_1_3.c: scope_hint: In function '__gmpn_mod_1s_3p'
gmp-6.2.1/longlong.h:1062:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'rl'
gmp-6.2.1/mpn/generic/mod_1_3.c:139:7: note: in expansion of macro 'umul_ppmm'
gmp-6.2.1/longlong.h:1064:30: note: in definition of macro 'umul_ppmm'
gmp-6.2.1/mpn/generic/mod_1_3.c:139:7: note: in expansion of macro 'umul_ppmm'
# 1060| #else
# 1061| #define umul_ppmm(w1, w0, u, v) \
# 1062|-> __asm__ ("mulq\t%3" \
# 1063| : "=a" (w0), "=d" (w1) \
# 1064| : "%0" ((UDItype)(u)), "rm" ((UDItype)(v)))
Error: COMPILER_WARNING (CWE-457): [#def4]
gmp-6.2.1/mpn/generic/mod_1_3.c:41: included_from: Included from here.
gmp-6.2.1/mpn/generic/mod_1_3.c: scope_hint: In function '__gmpn_mod_1s_3p'
gmp-6.2.1/longlong.h:1062:3: warning[-Wmaybe-uninitialized]: 'rh' may be used uninitialized
# 1062 | __asm__ ("mulq\t%3" \
# | ^~~~~~~
gmp-6.2.1/mpn/generic/mod_1_3.c:89:13: note: 'rh' was declared here
# 89 | mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
# | ^~
# 1060| #else
# 1061| #define umul_ppmm(w1, w0, u, v) \
# 1062|-> __asm__ ("mulq\t%3" \
# 1063| : "=a" (w0), "=d" (w1) \
# 1064| : "%0" ((UDItype)(u)), "rm" ((UDItype)(v)))
Error: COMPILER_WARNING (CWE-457): [#def5]
gmp-6.2.1/longlong.h:1062:3: warning[-Wmaybe-uninitialized]: 'rl' may be used uninitialized
# 1062 | __asm__ ("mulq\t%3" \
# | ^~~~~~~
gmp-6.2.1/mpn/generic/mod_1_3.c:89:17: note: 'rl' was declared here
# 89 | mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
# | ^~
# 1060| #else
# 1061| #define umul_ppmm(w1, w0, u, v) \
# 1062|-> __asm__ ("mulq\t%3" \
# 1063| : "=a" (w0), "=d" (w1) \
# 1064| : "%0" ((UDItype)(u)), "rm" ((UDItype)(v)))
Error: COMPILER_WARNING: [#def6]
gmp-6.2.1/mpf/reldiff.c:39:20: warning[-Warray-parameter=]: argument 1 of type '__mpf_struct[1]' with mismatched bound
# 39 | mpf_reldiff (mpf_t rdiff, mpf_srcptr x, mpf_srcptr y)
# | ~~~~~~^~~~~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpf/reldiff.c:31: included_from: Included from here.
gmp-6.2.1/gmp.h:1396:34: note: previously declared as 'mpf_ptr' {aka '__mpf_struct *'}
# 1396 | __GMP_DECLSPEC void mpf_reldiff (mpf_ptr, mpf_srcptr, mpf_srcptr);
# | ^~~~~~~
# 37|
# 38| void
# 39|-> mpf_reldiff (mpf_t rdiff, mpf_srcptr x, mpf_srcptr y)
# 40| {
# 41| if (UNLIKELY (SIZ(x) == 0))
Error: COMPILER_WARNING: [#def7]
gmp-6.2.1/mpf/set_q.c:54:18: warning[-Warray-parameter=]: argument 1 of type '__mpf_struct[1]' with mismatched bound
# 54 | mpf_set_q (mpf_t r, mpq_srcptr q)
# | ~~~~~~^
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpf/set_q.c:31: included_from: Included from here.
gmp-6.2.1/gmp.h:1414:32: note: previously declared as 'mpf_ptr' {aka '__mpf_struct *'}
# 1414 | __GMP_DECLSPEC void mpf_set_q (mpf_ptr, mpq_srcptr);
# | ^~~~~~~
# 52|
# 53| void
# 54|-> mpf_set_q (mpf_t r, mpq_srcptr q)
# 55| {
# 56| mp_srcptr np, dp;
Error: GCC_ANALYZER_WARNING (CWE-457): [#def8]
gmp-6.2.1/mpn/generic/mu_divappr_q.c: scope_hint: In function 'mpn_preinv_mu_divappr_q'
gmp-6.2.1/mpn/generic/mu_divappr_q.c:291:6: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'cy'
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpn/generic/mu_divappr_q.c:71: included_from: Included from here.
gmp-6.2.1/gmp.h:1468:19: note: in expansion of macro '__MPN'
gmp-6.2.1/mpn/generic/mu_divappr_q.c:291:9: note: in expansion of macro 'mpn_add_1'
gmp-6.2.1/gmp.h:2068:3: note: in expansion of macro '__GMPN_AORS_1'
gmp-6.2.1/gmp.h:2155:3: note: in expansion of macro '__GMPN_ADD_1'
gmp-6.2.1/mpn/generic/mu_divappr_q.c: scope_hint: In function 'mpn_preinv_mu_divappr_q'
# 289| quotient; add 3 with saturating arithmetic. */
# 290| qn = nn - dn;
# 291|-> cy += mpn_add_1 (qp, qp, qn, 3);
# 292| if (cy != 0)
# 293| {
Error: CLANG_WARNING: [#def9]
gmp-6.2.1/mpn/generic/mu_divappr_q.c:291:6: warning[core.uninitialized.Assign]: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
# 289| quotient; add 3 with saturating arithmetic. */
# 290| qn = nn - dn;
# 291|-> cy += mpn_add_1 (qp, qp, qn, 3);
# 292| if (cy != 0)
# 293| {
Error: COMPILER_WARNING (CWE-457): [#def10]
gmp-6.2.1/mpn/generic/mu_divappr_q.c:292:6: warning[-Wmaybe-uninitialized]: 'cy' may be used uninitialized
# 292 | if (cy != 0)
# | ^
gmp-6.2.1/mpn/generic/mu_divappr_q.c: scope_hint: In function '__gmpn_mu_divappr_q'
gmp-6.2.1/mpn/generic/mu_divappr_q.c:172:13: note: 'cy' was declared here
# 172 | mp_limb_t cy, cx, qh;
# | ^~
# 290| qn = nn - dn;
# 291| cy += mpn_add_1 (qp, qp, qn, 3);
# 292|-> if (cy != 0)
# 293| {
# 294| if (qh != 0)
Error: CLANG_WARNING: [#def11]
gmp-6.2.1/mpn/generic/mul_fft.c:828:4: warning[deadcode.DeadStores]: Value stored to 'cc' is never read
# 826| else
# 827| {
# 828|-> cc = mpn_sub_1 (p + pla - pl, p + pla - pl, pl, cc);
# 829| ASSERT (cc == 0);
# 830| }
Error: COMPILER_WARNING: [#def12]
gmp-6.2.1/mpq/canonicalize.c:35:25: warning[-Warray-parameter=]: argument 1 of type '__mpq_struct[1]' with mismatched bound
# 35 | mpq_canonicalize (mpq_t op)
# | ~~~~~~^~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpq/canonicalize.c:32: included_from: Included from here.
gmp-6.2.1/gmp.h:1144:39: note: previously declared as 'mpq_ptr' {aka '__mpq_struct *'}
# 1144 | __GMP_DECLSPEC void mpq_canonicalize (mpq_ptr);
# | ^~~~~~~
# 33|
# 34| void
# 35|-> mpq_canonicalize (mpq_t op)
# 36| {
# 37| mpz_t gcd;
Error: COMPILER_WARNING: [#def13]
gmp-6.2.1/mpq/clear.c:35:18: warning[-Warray-parameter=]: argument 1 of type '__mpq_struct[1]' with mismatched bound
# 35 | mpq_clear (mpq_t x)
# | ~~~~~~^
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpq/clear.c:32: included_from: Included from here.
gmp-6.2.1/gmp.h:1147:32: note: previously declared as 'mpq_ptr' {aka '__mpq_struct *'}
# 1147 | __GMP_DECLSPEC void mpq_clear (mpq_ptr);
# | ^~~~~~~
# 33|
# 34| void
# 35|-> mpq_clear (mpq_t x)
# 36| {
# 37| if (ALLOC (NUM(x)))
Error: COMPILER_WARNING: [#def14]
gmp-6.2.1/mpq/init.c:35:17: warning[-Warray-parameter=]: argument 1 of type '__mpq_struct[1]' with mismatched bound
# 35 | mpq_init (mpq_t x)
# | ~~~~~~^
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpq/init.c:32: included_from: Included from here.
gmp-6.2.1/gmp.h:1186:31: note: previously declared as 'mpq_ptr' {aka '__mpq_struct *'}
# 1186 | __GMP_DECLSPEC void mpq_init (mpq_ptr);
# | ^~~~~~~
# 33|
# 34| void
# 35|-> mpq_init (mpq_t x)
# 36| {
# 37| static const mp_limb_t dummy_limb=0xc1a0;
Error: COMPILER_WARNING: [#def15]
gmp-6.2.1/mpq/set_si.c:35:19: warning[-Warray-parameter=]: argument 1 of type '__mpq_struct[1]' with mismatched bound
# 35 | mpq_set_si (mpq_t dest, signed long int num, unsigned long int den)
# | ~~~~~~^~~~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpq/set_si.c:32: included_from: Included from here.
gmp-6.2.1/gmp.h:1231:33: note: previously declared as 'mpq_ptr' {aka '__mpq_struct *'}
# 1231 | __GMP_DECLSPEC void mpq_set_si (mpq_ptr, signed long int, unsigned long int);
# | ^~~~~~~
# 33|
# 34| void
# 35|-> mpq_set_si (mpq_t dest, signed long int num, unsigned long int den)
# 36| {
# 37| if (GMP_NUMB_BITS < BITS_PER_ULONG)
Error: COMPILER_WARNING: [#def16]
gmp-6.2.1/mpq/set_ui.c:35:19: warning[-Warray-parameter=]: argument 1 of type '__mpq_struct[1]' with mismatched bound
# 35 | mpq_set_ui (mpq_t dest, unsigned long int num, unsigned long int den)
# | ~~~~~~^~~~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/mpq/set_ui.c:32: included_from: Included from here.
gmp-6.2.1/gmp.h:1237:33: note: previously declared as 'mpq_ptr' {aka '__mpq_struct *'}
# 1237 | __GMP_DECLSPEC void mpq_set_ui (mpq_ptr, unsigned long int, unsigned long int);
# | ^~~~~~~
# 33|
# 34| void
# 35|-> mpq_set_ui (mpq_t dest, unsigned long int num, unsigned long int den)
# 36| {
# 37| if (GMP_NUMB_BITS < BITS_PER_ULONG)
Error: CLANG_WARNING: [#def17]
gmp-6.2.1/mpz/nextprime.c:124:7: warning[deadcode.DeadStores]: Value stored to 'difference' is never read
# 122| }
# 123| mpz_add_ui (p, p, difference);
# 124|-> difference = 0;
# 125| }
# 126| done:
Error: CLANG_WARNING: [#def18]
gmp-6.2.1/primesieve.c:269:25: warning[core.UndefinedBinaryOperatorResult]: The right operand of '<<' is a garbage value
# 267| if (n_to_bit (SEED_LIMIT + 1) < GMP_LIMB_BITS)
# 268| i = 0;
# 269|-> mask = CNST_LIMB(1) << i;
# 270| index = 0;
# 271| do {
Error: COMPILER_WARNING: [#def19]
gmp-6.2.1/rand/randbui.c:38:36: warning[-Warray-parameter=]: argument 1 of type 'gmp_randstate_ptr' {aka '__gmp_randstate_struct *'} declared as a pointer
# 38 | gmp_urandomb_ui (gmp_randstate_ptr rstate, unsigned long bits)
# | ~~~~~~~~~~~~~~~~~~^~~~~~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/rand/randbui.c:31: included_from: Included from here.
gmp-6.2.1/gmp.h:527:47: note: previously declared as an array '__gmp_randstate_struct[1]'
# 527 | __GMP_DECLSPEC unsigned long gmp_urandomb_ui (gmp_randstate_t, unsigned long);
# | ^~~~~~~~~~~~~~~
# 36|
# 37| unsigned long
# 38|-> gmp_urandomb_ui (gmp_randstate_ptr rstate, unsigned long bits)
# 39| {
# 40| mp_limb_t a[LIMBS_PER_ULONG];
Error: COMPILER_WARNING: [#def20]
gmp-6.2.1/rand/randiset.c:35:37: warning[-Warray-parameter=]: argument 1 of type 'gmp_randstate_ptr' {aka '__gmp_randstate_struct *'} declared as a pointer
# 35 | gmp_randinit_set (gmp_randstate_ptr dst, gmp_randstate_srcptr src)
# | ~~~~~~~~~~~~~~~~~~^~~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/rand/randiset.c:31: included_from: Included from here.
gmp-6.2.1/gmp.h:515:39: note: previously declared as an array '__gmp_randstate_struct[1]'
# 515 | __GMP_DECLSPEC void gmp_randinit_set (gmp_randstate_t, const __gmp_randstate_struct *);
# | ^~~~~~~~~~~~~~~
# 33|
# 34| void
# 35|-> gmp_randinit_set (gmp_randstate_ptr dst, gmp_randstate_srcptr src)
# 36| {
# 37| (*((gmp_randfnptr_t *) RNG_FNPTR (src))->randiset_fn) (dst, src);
Error: COMPILER_WARNING (CWE-563): [#def21]
gmp-6.2.1/rand/randlc2x.c: scope_hint: In function 'lc'
gmp-6.2.1/rand/randlc2x.c:79:7: warning[-Wunused-but-set-variable]: variable 'cy' set but not used
# 79 | int cy;
# | ^~
# 77| unsigned long int m2exp;
# 78| unsigned long int bits;
# 79|-> int cy;
# 80| mp_size_t xn;
# 81| gmp_rand_lc_struct *p;
Error: COMPILER_WARNING: [#def22]
gmp-6.2.1/rand/randmt.c:396:45: warning[-Warray-parameter=]: argument 1 of type 'gmp_randstate_ptr' {aka '__gmp_randstate_struct *'} declared as a pointer
# 396 | __gmp_randinit_mt_noseed (gmp_randstate_ptr dst)
# | ~~~~~~~~~~~~~~~~~~^~~
gmp-6.2.1/rand/randmt.c:37: included_from: Included from here.
gmp-6.2.1/gmp-impl.h:1316:47: note: previously declared as an array '__gmp_randstate_struct[1]'
# 1316 | __GMP_DECLSPEC void __gmp_randinit_mt_noseed (gmp_randstate_t);
# | ^~~~~~~~~~~~~~~
# 394|
# 395| void
# 396|-> __gmp_randinit_mt_noseed (gmp_randstate_ptr dst)
# 397| {
# 398| const mp_size_t sz = ((sizeof (gmp_rand_mt_struct) - 1) / GMP_LIMB_BYTES) + 1;
Error: COMPILER_WARNING: [#def23]
gmp-6.2.1/rand/randmui.c:46:36: warning[-Warray-parameter=]: argument 1 of type 'gmp_randstate_ptr' {aka '__gmp_randstate_struct *'} declared as a pointer
# 46 | gmp_urandomm_ui (gmp_randstate_ptr rstate, unsigned long n)
# | ~~~~~~~~~~~~~~~~~~^~~~~~
gmp-6.2.1/gmp-impl.h:145: included_from: Included from here.
gmp-6.2.1/rand/randmui.c:31: included_from: Included from here.
gmp-6.2.1/gmp.h:530:47: note: previously declared as an array '__gmp_randstate_struct[1]'
# 530 | __GMP_DECLSPEC unsigned long gmp_urandomm_ui (gmp_randstate_t, unsigned long);
# | ^~~~~~~~~~~~~~~
# 44|
# 45| unsigned long
# 46|-> gmp_urandomm_ui (gmp_randstate_ptr rstate, unsigned long n)
# 47| {
# 48| mp_limb_t a[LIMBS_PER_ULONG];
Error: COMPILER_WARNING (CWE-563): [#def24]
gmp-6.2.1/scanf/doscan.c: scope_hint: In function '__gmp_doscan'
gmp-6.2.1/scanf/doscan.c:474:33: warning[-Wunused-but-set-variable]: variable 'end_fmt' set but not used
# 474 | const char *fmt, *this_fmt, *end_fmt;
# | ^~~~~~~
# 472| va_list ap;
# 473| char *alloc_fmt;
# 474|-> const char *fmt, *this_fmt, *end_fmt;
# 475| size_t orig_fmt_len, alloc_fmt_size, len;
# 476| int new_fields, new_chars;
Error: CLANG_WARNING: [#def25]
gmp-6.2.1/scanf/doscan.c:502:3: warning[deadcode.DeadStores]: Value stored to 'end_fmt' is never read
# 500|
# 501| fmt = orig_fmt;
# 502|-> end_fmt = orig_fmt + orig_fmt_len;
# 503|
# 504| for (;;)
Scan Properties
analyzer-version-clang | 18.1.3 |
analyzer-version-cppcheck | 2.13.0 |
analyzer-version-gcc | 14.0.1 |
analyzer-version-gcc-analyzer | 14.0.1 |
analyzer-version-shellcheck | 0.10.0 |
diffbase-analyzer-version-clang | 18.1.3 |
diffbase-analyzer-version-cppcheck | 2.13.0 |
diffbase-analyzer-version-gcc | 14.0.1 |
diffbase-analyzer-version-gcc-analyzer | 14.0.1 |
diffbase-analyzer-version-shellcheck | 0.10.0 |
diffbase-enabled-plugins | clang, cppcheck, gcc, shellcheck |
diffbase-exit-code | 0 |
diffbase-host | ip-172-16-1-201.us-west-2.compute.internal |
diffbase-mock-config | fedora-41-x86_64 |
diffbase-project-name | gmp-6.3.0-1.fc41 |
diffbase-store-results-to | /tmp/tmpzemw8hvr/gmp-6.3.0-1.fc41.tar.xz |
diffbase-time-created | 2024-04-22 10:56:30 |
diffbase-time-finished | 2024-04-22 11:01:58 |
diffbase-tool | csmock |
diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpzemw8hvr/gmp-6.3.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpzemw8hvr/gmp-6.3.0-1.fc41.src.rpm' |
diffbase-tool-version | csmock-3.5.3-1.el9 |
enabled-plugins | clang, cppcheck, gcc, shellcheck |
exit-code | 0 |
host | ip-172-16-1-201.us-west-2.compute.internal |
mock-config | fedora-41-x86_64 |
project-name | gmp-6.2.1-8.fc40 |
store-results-to | /tmp/tmpdqzf16tb/gmp-6.2.1-8.fc40.tar.xz |
time-created | 2024-04-22 10:50:38 |
time-finished | 2024-04-22 10:56:03 |
title | Fixed defects |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpdqzf16tb/gmp-6.2.1-8.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpdqzf16tb/gmp-6.2.1-8.fc40.src.rpm' |
tool-version | csmock-3.5.3-1.el9 |