Skip to content

Temporarily disable `noreturn` attribute test

Josh Megnauth requested to merge josh/relibc:fix-failing-features-test into master

The test works fine with exit, abort, et al. in Redox and Linux, but it fails in the build system because exit is supposedly not declared with noreturn. Weirdly, exit is declared with noreturn as in glibc, and so the test compiles without warning in Redox.

I originally fixed this by using _Exit which worked in CI yet it still failed with make r.relibc-tests.

I have a hunch that this issue is similar to the reason why glib doesn't compile. glib fails with odd errors about certain functions or includes not existing even though they clearly exist. Running test code using those headers works in Redox itself but breaks in the build system. That glib error is similar to the test's error: exit (and the rest) are declared with noreturn and work in Redox (and Linux with relibc's features.h) yet break in the build system. Very puzzling.

Try compiling this in Redox with -Wall -Wextra -pedantic. No warnings. 🤔

#include <features.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>

__noreturn
static void abort_works(void) {
    abort();
}

__noreturn
static void exit_works(void) {
    exit(0);
}

__noreturn
static void _exit_works(void) {
    _exit(0);
}

int main(void) {
    if (false) {
        abort_works();
    }
    if (false) {
        _exit_works();
    }

    exit_works();
}
Edited by Josh Megnauth

Merge request reports