Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f1ec12

Browse files
author
Stefan Krah
committed
Issue #19986: Avoid an incorrect warning of older gcc versions.
1 parent c836a28 commit 1f1ec12

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/_decimal/libmpdec/mpdecimal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,21 +4421,22 @@ mpd_qfma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c,
44214421
const mpd_context_t *ctx, uint32_t *status)
44224422
{
44234423
uint32_t workstatus = 0;
4424-
const mpd_t *cc = c;
4424+
mpd_t *cc = NULL;
44254425

44264426
if (result == c) {
44274427
if ((cc = mpd_qncopy(c)) == NULL) {
44284428
mpd_seterror(result, MPD_Malloc_error, status);
44294429
return;
44304430
}
4431+
c = cc;
44314432
}
44324433

44334434
_mpd_qmul(result, a, b, ctx, &workstatus);
44344435
if (!(workstatus&MPD_Invalid_operation)) {
4435-
mpd_qadd(result, result, cc, ctx, &workstatus);
4436+
mpd_qadd(result, result, c, ctx, &workstatus);
44364437
}
44374438

4438-
if (cc != c) mpd_del((mpd_t *)cc);
4439+
if (cc) mpd_del(cc);
44394440
*status |= workstatus;
44404441
}
44414442

0 commit comments

Comments
 (0)