Fixed error with cmake not taking build flags
This commit is contained in:
@ -6,11 +6,7 @@ set(CMAKE_C_STANDARD 17)
|
|||||||
add_executable($ENV{MAKE_NAME})
|
add_executable($ENV{MAKE_NAME})
|
||||||
|
|
||||||
if(NOT "$ENV{MAKE_CFLAGS}" STREQUAL "")
|
if(NOT "$ENV{MAKE_CFLAGS}" STREQUAL "")
|
||||||
string(REPLACE " " ";" CFLAGS_LIST $ENV{MAKE_CFLAGS})
|
set_target_properties($ENV{MAKE_NAME} PROPERTIES COMPILE_FLAGS $ENV{MAKE_CFLAGS})
|
||||||
foreach(X IN LISTS CFLAGS_LIST)
|
|
||||||
message(STATUS "Using C compilation flag ${X}")
|
|
||||||
add_compile_options(${X})
|
|
||||||
endforeach()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT "$ENV{MAKE_C_SRCS}" STREQUAL "")
|
if(NOT "$ENV{MAKE_C_SRCS}" STREQUAL "")
|
||||||
|
@ -25,6 +25,7 @@ static error_t parse_opt(int key, char* arg, struct argp_state* state) {
|
|||||||
break;
|
break;
|
||||||
case ARG_TTL:
|
case ARG_TTL:
|
||||||
arguments->ttl = strtoul(arg, NULL, 10);
|
arguments->ttl = strtoul(arg, NULL, 10);
|
||||||
|
__attribute__ ((fallthrough));
|
||||||
case ARGP_KEY_ARG:
|
case ARGP_KEY_ARG:
|
||||||
if (state->arg_num >= 2)
|
if (state->arg_num >= 2)
|
||||||
argp_usage(state);
|
argp_usage(state);
|
||||||
@ -40,7 +41,7 @@ static error_t parse_opt(int key, char* arg, struct argp_state* state) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct argp argp = {options, parse_opt, args_doc, doc};
|
static struct argp argp = {options, parse_opt, args_doc, doc, NULL, NULL, NULL};
|
||||||
|
|
||||||
static bool stop = false;
|
static bool stop = false;
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ double avg = 0;
|
|||||||
uint16_t calc_checksum(void * b, const size_t l) {
|
uint16_t calc_checksum(void * b, const size_t l) {
|
||||||
uint16_t sum = 0;
|
uint16_t sum = 0;
|
||||||
|
|
||||||
for (int i = 0; i < l; i++) {
|
for (size_t i = 0; i < l; i++) {
|
||||||
sum += *((uint16_t*)b + i);
|
sum += *((uint16_t*)b + i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +73,7 @@ void send_ping() {
|
|||||||
packet.hdr.un.echo.id = getpid();
|
packet.hdr.un.echo.id = getpid();
|
||||||
packet.hdr.un.echo.sequence = xmit++;
|
packet.hdr.un.echo.sequence = xmit++;
|
||||||
|
|
||||||
for (int i = 0; i < sizeof(packet.msg) - 1; ++i) {
|
for (long unsigned i = 0; i < sizeof(packet.msg) - 1; ++i) {
|
||||||
packet.msg[i] = (char)i;
|
packet.msg[i] = (char)i;
|
||||||
}
|
}
|
||||||
packet.msg[sizeof(packet.msg) - 1] = '\0';
|
packet.msg[sizeof(packet.msg) - 1] = '\0';
|
||||||
|
Reference in New Issue
Block a user