Skip to content

Commit

Permalink
Merge pull request #5842 from kmk3/build-enable-warnings
Browse files Browse the repository at this point in the history
build: enable compiler warnings by default
  • Loading branch information
netblue30 authored May 31, 2023
2 parents f1218ef + 9409065 commit 30ff544
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ Optional Features:
--disable-x11 disable X11 sandboxing support
--disable-file-transfer disable file transfer
--disable-suid install as a non-SUID executable
--enable-fatal-warnings -W -Wall -Werror
--enable-fatal-warnings -W -Werror
--enable-busybox-workaround
enable busybox workaround
--enable-gcov Gcov instrumentation
Expand Down Expand Up @@ -3601,7 +3601,7 @@ fi
if test "x$enable_fatal_warnings" = "xyes"; then :
HAVE_FATAL_WARNINGS="-W -Wall -Werror"
HAVE_FATAL_WARNINGS="-W -Werror"
fi
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ AS_IF([test "x$enable_suid" != "xno"], [
HAVE_FATAL_WARNINGS=""
AC_SUBST([HAVE_FATAL_WARNINGS])
AC_ARG_ENABLE([fatal_warnings],
[AS_HELP_STRING([--enable-fatal-warnings], [-W -Wall -Werror])])
[AS_HELP_STRING([--enable-fatal-warnings], [-W -Werror])])
AS_IF([test "x$enable_fatal_warnings" = "xyes"], [
HAVE_FATAL_WARNINGS="-W -Wall -Werror"
HAVE_FATAL_WARNINGS="-W -Werror"
])

BUSYBOX_WORKAROUND="no"
Expand Down
6 changes: 4 additions & 2 deletions src/prog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS)
OBJS := $(SRCS:.c=.o) $(MOD_OBJS)

PROG_CFLAGS = \
-ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' \
-fstack-protector-all -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security \
-ggdb -O2 -DVERSION='"$(VERSION)"' \
-Wall -Wextra $(HAVE_FATAL_WARNINGS) \
-Wformat -Wformat-security \
-fstack-protector-all -D_FORTIFY_SOURCE=2 \
-fPIE \
-DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' \
-DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \
Expand Down
6 changes: 4 additions & 2 deletions src/so.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS)
OBJS := $(SRCS:.c=.o) $(MOD_OBJS)

SO_CFLAGS = \
-ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' \
-fstack-protector-all -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security \
-ggdb -O2 -DVERSION='"$(VERSION)"' \
-Wall -Wextra $(HAVE_FATAL_WARNINGS) \
-Wformat -Wformat-security \
-fstack-protector-all -D_FORTIFY_SOURCE=2 \
-fPIC

SO_LDFLAGS = -pie -fPIE -Wl,-z,relro -Wl,-z,now
Expand Down

0 comments on commit 30ff544

Please sign in to comment.