Strict compiler with reldeb default build.

This commit is contained in:
Nicolás A. Ortega 2016-07-04 16:17:16 +02:00
parent 597fc22124
commit 156f8de5c0
No known key found for this signature in database
GPG Key ID: 4825F773B8D44EFF
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(MMMCalc) project(MMMCalc)
set(CMAKE_C_FLAGS "-Wall -Wextra -pedantic-errors") if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
set(CMAKE_C_FLAGS "-std=gnu99 -Wall -Wextra -Werror -Wpedantic -Wmissing-declarations -Wfatal-errors -pedantic-errors")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -O0") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -O0")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O3") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O3")

View File

@ -5,7 +5,7 @@
char version[16] = "v0.5"; char version[16] = "v0.5";
int verbose = 0; int verbose = 0;
int main(int argc, char **argv) { int main(/*int argc, char **argv*/) {
printf("MMMCalc %s, Copyright (c) 2016 Nicolás A. Ortega.\n", version); printf("MMMCalc %s, Copyright (c) 2016 Nicolás A. Ortega.\n", version);
printf("This program comes with ABSOLUTELY NO WARRANTY.\n"); printf("This program comes with ABSOLUTELY NO WARRANTY.\n");
printf("This program is free software and you are welcome to redistribute\n"); printf("This program is free software and you are welcome to redistribute\n");