From bf735b2c47f225719f6b30630f3ab0b689fa705e Mon Sep 17 00:00:00 2001 From: Bernhard Nortmann Date: Thu, 10 Nov 2016 10:50:20 +0100 Subject: [PATCH] Makefile: Modify default CFLAGS This removes the "-g -O0" default (to leave them up to the user CFLAGS), and adds a switch to ignore "unused result" warnings. The latter is relevant when trying to compile nand-part.c with optimizations enabled. Signed-off-by: Bernhard Nortmann --- .travis.yml | 2 +- Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e96744..09b01a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ language: c # treat all warnings as errors, fake cross-toolchain (build everything on host) env: - - CFLAGS=-Werror CROSS_COMPILE="" + - CFLAGS="-g -O2 -Werror" CROSS_COMPILE="" os: - linux diff --git a/Makefile b/Makefile index e66dd6e..65bdcdc 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,8 @@ # along with this program. If not, see . CC ?= gcc -DEFAULT_CFLAGS := -g -O0 -Wall -Wextra -std=c99 +DEFAULT_CFLAGS := -std=c99 +DEFAULT_CFLAGS += -Wall -Wextra -Wno-unused-result DEFAULT_CFLAGS += -D_POSIX_C_SOURCE=200112L # Define _BSD_SOURCE, necessary to expose all endian conversions properly.