Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CC ?= gcc
CFLAGS := -O -g \
-std=c99 -pedantic

Expand All @@ -14,7 +13,8 @@ CFLAGS_TO_CHECK := \
-Wno-strict-prototypes \
-Wno-declaration-after-statement \
-Wno-format \
-Wno-format-pedantic
-Wno-format-pedantic \
-Wno-overflow

SUPPORTED_CFLAGS :=
# Check if a specific compiler flag is supported, attempting a dummy compilation
Expand Down
14 changes: 11 additions & 3 deletions lib/c.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,18 @@ void abort(void);

int strlen(char *str)
{
/* process the string by checking 4 characters (a 32-bit word) at a time */
int i = 0;
while (str[i])
i++;
return i;
for (;; i += 4) {
if (!str[i])
return i;
if (!str[i + 1])
return i + 1;
if (!str[i + 2])
return i + 2;
if (!str[i + 3])
return i + 3;
}
}

int strcmp(char *s1, char *s2)
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/fib-arm.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/snapshots/fib-riscv.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/snapshots/hello-arm.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/snapshots/hello-riscv.json

Large diffs are not rendered by default.