Skip to content

Add -Wno-missing-noreturn to clang flags

Description

The -Wmissing-noreturn flag, which is turned on by the -Weverything flag, prints warnings whenever a function does not have a ret call. This means that code that calls exit somewhere, for example, will fail to compile without adding compiler specific attributes to a function.

Example

The following example will fail to compile

void fatal()
{
    exit(EXIT_FAILURE);
}

int main()
{
    fatal();
    /* remaining code omitted */
}

Fix:

Add -Wno-missing-noreturn to the clang flag list.