diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1ab63c1159..7210146e88 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,16 +35,19 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - compiler: [clang, gcc] + compiler: [clang, gcc, gcc-12] exclude: - os: macos-latest compiler: gcc + - os: macos-latest + compiler: gcc-12 runs-on: ${{ matrix.os }} # See design.mps.tests.ci.run.posix. steps: - uses: actions/checkout@v3 + - run: ${{ matrix.compiler }} --version - run: CC=${{ matrix.compiler }} ./configure - run: make - run: make test diff --git a/code/arenavm.c b/code/arenavm.c index 50708e9563..11aca9d1c9 100644 --- a/code/arenavm.c +++ b/code/arenavm.c @@ -600,7 +600,7 @@ static Res VMArenaCreate(Arena *arenaReturn, ArgList args) VM vm = &vmStruct; Chunk chunk; mps_arg_s arg; - char vmParams[VMParamSize]; + char vmParams[VMParamSize] = {0}; /* suppress uninitialized warning from GCC 12.2 */ AVER(arenaReturn != NULL); AVERT(ArgList, args); diff --git a/code/ss.c b/code/ss.c index ce088101f1..2f421b88d4 100644 --- a/code/ss.c +++ b/code/ss.c @@ -1,7 +1,7 @@ /* ss.c: STACK SCANNING * * $Id$ - * Copyright (c) 2001-2020 Ravenbrook Limited. See end of file for license. + * Copyright (c) 2001-2023 Ravenbrook Limited. See end of file for license. * * This scans the mutator's stack and fixes the registers that may * contain roots. . @@ -30,12 +30,32 @@ SRCID(ss, "$Id$"); * stack by the caller below its other local data, so as long as * it does not use something like alloca, the address of the argument * is a hot stack pointer. . + * */ ATTRIBUTE_NOINLINE void StackHot(void **stackOut) { + /* GCC 13.1 legitimately complains about us leaking a dangling + pointer (-Wdangling-pointer) -- it's exactly what we are trying to + do. Rather that suppressing this warning globally, we use + Diagnostic Pragmas + to + suppress the warning only here. */ +#if CONFIG_BUILD_GC +# pragma GCC diagnostic push + /* Prevent GCC 11 and GCC 12 producing warnings that they don't know + about -Wdangling-pointer and -Wunknown-warning-option. */ +# pragma GCC diagnostic ignored "-Wpragmas" +# pragma GCC diagnostic ignored "-Wunknown-warning-option" +# pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif + *stackOut = &stackOut; + +#if CONFIG_BUILD_GC +# pragma GCC diagnostic pop +#endif } @@ -71,7 +91,7 @@ Res StackScan(ScanState ss, void *stackCold, /* C. COPYRIGHT AND LICENSE * - * Copyright (C) 2001-2020 Ravenbrook Limited . + * Copyright (C) 2001-2023 Ravenbrook Limited . * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are