From 5fb40f71589f7c5e58a1e90f963d1ecf83226876 Mon Sep 17 00:00:00 2001 From: Evan McClure Date: Tue, 9 Apr 2024 12:48:29 -0700 Subject: [PATCH 1/2] Pin C std to c11 Make the C std on the CLI consistent with VSCode --- scripts/shell/build_artifact.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/shell/build_artifact.sh b/scripts/shell/build_artifact.sh index faf9aeb..3239191 100755 --- a/scripts/shell/build_artifact.sh +++ b/scripts/shell/build_artifact.sh @@ -7,7 +7,7 @@ ARCH="${ARCH-}" TECH="${TECH-}" ARTIFACT="${ARTIFACT-}" CC="${CC:-clang}" -CFLAGS_ARRAY=(-Wall -fdiagnostics-color=always) +CFLAGS_ARRAY=(-Wall -fdiagnostics-color=always -std=c11) # Check and add CFLAGS to CFLAGS_ARRAY if [ -n "${CFLAGS-}" ]; then From 88b7bcf7727ff272a1084be77fdeafb61d5b02f2 Mon Sep 17 00:00:00 2001 From: Evan McClure Date: Tue, 9 Apr 2024 14:31:42 -0700 Subject: [PATCH 2/2] Changed C std from c11 to c99 --- .vscode/c_cpp_properties.json | 2 +- examples/arch/arm/cmsis-dsp/dot_product/main.c | 1 + examples/arch/arm/neon/dot_product/main.c | 1 + examples/arch/generic/dot_product/main.c | 1 + scripts/shell/build_artifact.sh | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index e011f48..380c223 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -20,7 +20,7 @@ "defines": [ "${defines}" ], - "cStandard": "c11", + "cStandard": "c99", "cppStandard": "c++17", "macFrameworkPath": [ "/System/Library/Frameworks", diff --git a/examples/arch/arm/cmsis-dsp/dot_product/main.c b/examples/arch/arm/cmsis-dsp/dot_product/main.c index 8f1befe..d3a60c3 100644 --- a/examples/arch/arm/cmsis-dsp/dot_product/main.c +++ b/examples/arch/arm/cmsis-dsp/dot_product/main.c @@ -1,3 +1,4 @@ +#define _POSIX_C_SOURCE 199309L #include "arch/arm/cmsis-dsp/nn_dot_product.h" #include "nn_app.h" #include "nn_config.h" diff --git a/examples/arch/arm/neon/dot_product/main.c b/examples/arch/arm/neon/dot_product/main.c index 6eb9904..ba3edff 100644 --- a/examples/arch/arm/neon/dot_product/main.c +++ b/examples/arch/arm/neon/dot_product/main.c @@ -1,3 +1,4 @@ +#define _POSIX_C_SOURCE 199309L #include "arch/arm/neon/nn_dot_product.h" #include "nn_app.h" #include "nn_config.h" diff --git a/examples/arch/generic/dot_product/main.c b/examples/arch/generic/dot_product/main.c index 41c1d77..f974ee4 100644 --- a/examples/arch/generic/dot_product/main.c +++ b/examples/arch/generic/dot_product/main.c @@ -1,3 +1,4 @@ +#define _POSIX_C_SOURCE 199309L #include "nn_app.h" #include "nn_config.h" #include "nn_dot_product.h" diff --git a/scripts/shell/build_artifact.sh b/scripts/shell/build_artifact.sh index 3239191..98fa23d 100755 --- a/scripts/shell/build_artifact.sh +++ b/scripts/shell/build_artifact.sh @@ -7,7 +7,7 @@ ARCH="${ARCH-}" TECH="${TECH-}" ARTIFACT="${ARTIFACT-}" CC="${CC:-clang}" -CFLAGS_ARRAY=(-Wall -fdiagnostics-color=always -std=c11) +CFLAGS_ARRAY=(-Wall -fdiagnostics-color=always -std=c99) # Check and add CFLAGS to CFLAGS_ARRAY if [ -n "${CFLAGS-}" ]; then