From df669340109a747eb942ccc380c0cb1f6ea0eeb0 Mon Sep 17 00:00:00 2001 From: ion098 <146852218+ion098@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:23:37 +0000 Subject: [PATCH] build: :technologist: Compile with more warnings and -Werror --- Makefile | 6 ++++-- include/gamepad/recursive_mutex.hpp | 3 +++ include/main.h | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 10d24a2..f697585 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,10 @@ BINDIR=$(ROOT)/bin SRCDIR=$(ROOT)/src INCDIR=$(ROOT)/include -WARNFLAGS+= +WARNFLAGS+= -Wall -Wextra -Wpedantic +ifndef ALLOW_WARN +WARNFLAGS+= -Werror +endif EXTRA_CFLAGS= EXTRA_CXXFLAGS= @@ -25,7 +28,6 @@ EXCLUDE_COLD_LIBRARIES:= # Set this to 1 to add additional rules to compile your project as a PROS library template IS_LIBRARY:=1 -# TODO: CHANGE THIS! LIBNAME:=gamepad VERSION:=0.0.1 # EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c diff --git a/include/gamepad/recursive_mutex.hpp b/include/gamepad/recursive_mutex.hpp index d892f2c..40c76fa 100644 --- a/include/gamepad/recursive_mutex.hpp +++ b/include/gamepad/recursive_mutex.hpp @@ -1,5 +1,8 @@ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" // apix.h includes llemu headers (???) which trigger this warning #include "pros/apix.h" #include "pros/rtos.h" +#pragma GCC diagnostic pop namespace Gamepad::_impl { diff --git a/include/main.h b/include/main.h index 42e7817..a6e6dde 100644 --- a/include/main.h +++ b/include/main.h @@ -34,7 +34,10 @@ */ #define PROS_USE_LITERALS +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" // api.h includes llemu headers which trigger this warning #include "api.h" +#pragma GCC diagnostic pop /** * You should add more #includes here