Skip to content

Commit

Permalink
build: 🧑‍💻 Compile with more warnings and -Werror
Browse files Browse the repository at this point in the history
  • Loading branch information
ion098 committed Sep 10, 2024
1 parent d3536a3 commit df66934
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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=

Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions include/gamepad/recursive_mutex.hpp
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
3 changes: 3 additions & 0 deletions include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit df66934

Please sign in to comment.