Skip to content

Commit 3a1298f

Browse files
authored
Merge pull request #60 from pmeerw/fix-warning
error: fix warning, signedness of comparison
2 parents ef537ce + 534f955 commit 3a1298f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/error.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "error.hpp"
22

33
#include <cassert>
4+
#include <cstddef>
45

56
namespace cmkr {
67
namespace error {
@@ -20,6 +21,6 @@ static const char *err_string[] = {
2021
};
2122

2223
const char *cmkr_error_status(int i) {
23-
assert(i >= 0 && i < (sizeof(err_string) / sizeof(*(err_string))));
24+
assert(i >= 0 && static_cast<size_t>(i) < (sizeof(err_string) / sizeof(*(err_string))));
2425
return err_string[i];
2526
}

0 commit comments

Comments
 (0)