[Git][ghc/ghc][master] Fix C warnings (#25237)
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Sep 10 14:47:35 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
3b2dc826 by Sven Tennie at 2024-09-10T10:47:14-04:00
Fix C warnings (#25237)
GCC 14 treats the fixed warnings as errors by default. I.e. we're
gaining GCC 14 compatibility with these fixes.
- - - - -
2 changed files:
- libraries/ghc-heap/tests/stack_misc_closures_c.c
- testsuite/tests/rts/pause-resume/list_threads_and_misc_roots_c.c
Changes:
=====================================
libraries/ghc-heap/tests/stack_misc_closures_c.c
=====================================
@@ -193,7 +193,7 @@ void create_any_bco_frame(Capability *cap, StgStack *stack, StgWord w) {
StgWord bcoSizeWords =
sizeofW(StgBCO) + sizeofW(StgLargeBitmap) + sizeofW(StgWord);
StgBCO *bco = (StgBCO *)allocate(cap, bcoSizeWords);
- SET_HDR(bco, &stg_BCO_info, CCS_MAIN);
+ SET_HDR(bco, (StgInfoTable*) &stg_BCO_info, CCS_MAIN);
c->payload[0] = (StgClosure *)bco;
bco->size = bcoSizeWords;
=====================================
testsuite/tests/rts/pause-resume/list_threads_and_misc_roots_c.c
=====================================
@@ -27,10 +27,10 @@ void checkGcRoots(void)
rts_listThreads(&collectTSOsCallback, NULL);
for (int i = 0; i < tsoCount; i++)
{
- StgTSO *tso = UNTAG_CLOSURE(tsos[i]);
+ StgClosure *tso = UNTAG_CLOSURE((StgClosure*) tsos[i]);
if (get_itbl(tso)->type != TSO)
{
- fprintf(stderr, "tso returned a non-TSO type %zu at index %i\n",
+ fprintf(stderr, "tso returned a non-TSO type %u at index %i\n",
tso->header.info->type,
i);
exit(1);
@@ -44,7 +44,7 @@ void checkGcRoots(void)
StgClosure *root = UNTAG_CLOSURE(miscRoots[i]);
if (get_itbl(root)->type == TSO)
{
- fprintf(stderr, "rts_listThreads unexpectedly returned an TSO type at index %i (TSO=%zu)\n", i, TSO);
+ fprintf(stderr, "rts_listThreads unexpectedly returned an TSO type at index %i (TSO=%d)\n", i, TSO);
exit(1);
}
}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3b2dc826c9d4e65546ae3083303fdd491e74bd5a
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3b2dc826c9d4e65546ae3083303fdd491e74bd5a
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240910/ee208480/attachment-0001.html>
More information about the ghc-commits
mailing list