Update jerry-libc unreachable asserts (#1379)
Newer compilers (especially clang) warn (and fail) on `assert (!"message");` constructs typically used to assert on unreachable code paths (multiple occurrences in jerry-libc). A more up-to-date approach is to use `assert (false && "message");`. This patch applies the pattern to all relevant asserts in jerry-libc. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
@@ -134,13 +134,13 @@ fopen (const char *path, /**< file path */
|
||||
create_if_not_exist = true;
|
||||
if (mode[1] == '+')
|
||||
{
|
||||
assert (!"unsupported mode a+");
|
||||
assert (false && "unsupported mode a+");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
assert (!"unsupported mode");
|
||||
assert (false && "unsupported mode");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user