[Git][ghc/ghc][wip/supersven/fix-new-c-warnings] Fix C warnings (#25237)
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Thu Sep 5 14:25:33 UTC 2024
Sven Tennie pushed to branch wip/supersven/fix-new-c-warnings at Glasgow Haskell Compiler / GHC
Commits:
93c2a3ac by Sven Tennie at 2024-09-05T16:25:19+02: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/93c2a3ac3bafd879b6819c763b45edab5da58d0d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93c2a3ac3bafd879b6819c763b45edab5da58d0d
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/20240905/919be638/attachment-0001.html>
More information about the ghc-commits
mailing list