diff --git a/Kbuild b/Kbuild
index bf06edb7..6cbc79d3 100644
--- a/Kbuild
+++ b/Kbuild
@@ -82,6 +82,7 @@ $(foreach _module, $(NV_KERNEL_MODULES), \
 # $(EXTRA_CFLAGS) to ccflags-y for compatibility.
 #

+EXTRA_CFLAGS += -std=gnu17
 EXTRA_CFLAGS += -I$(src)/common/inc
 EXTRA_CFLAGS += -I$(src)
 EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
diff --git a/conftest.sh b/conftest.sh
index 20f694ec..0019e67c 100755
--- a/conftest.sh
+++ b/conftest.sh
@@ -69,7 +69,7 @@ test_header_presence() {
     # NV_LINUX_FENCE_H_PRESENT, and that is either defined or undefined, in the
     # output (which goes to stdout, just like the rest of this file).

-    TEST_CFLAGS="-E -M $CFLAGS"
+    TEST_CFLAGS="-std=gnu17 -E -M $CFLAGS"

     file="$1"
     file_define=NV_`echo $file | tr '/.-' '___' | tr 'a-z' 'A-Z'`_PRESENT
@@ -94,7 +94,7 @@ test_header_presence() {

 build_cflags() {
     ISYSTEM=`$CC -print-file-name=include 2> /dev/null`
-    BASE_CFLAGS="-O2 -D__KERNEL__ \
+    BASE_CFLAGS="-std=gnu17 -O2 -D__KERNEL__ \
 -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
 -nostdinc -isystem $ISYSTEM \
 -Wno-implicit-function-declaration -Wno-strict-prototypes"
