-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the bug
With "-Wall -Wstrict-prototypes -std=c99 -pedantic -Wcast-align" defined, multiple issues observed:
[ 14%] Building C object tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/cmdUtil.c.o
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c: In function ‘main’:
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil.c:507:17: warning: overflow in implicit constant conversion [-Woverflow]
tempShort = 0xC000; /* Sequence word. */
^
[ 28%] Building C object tools/cFS-GroundSystem/Subsystems/cmdUtil/CMakeFiles/cmdUtil.dir/SendUdp.c.o
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c: In function ‘SendUdp’:
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:55:25: error: storage size of ‘hints’ isn’t known
struct addrinfo hints;
^
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:78:30: error: invalid application of ‘sizeof’ to incomplete type ‘struct addrinfo’
memset(&hints, 0, sizeof(struct addrinfo));
^
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:81:25: error: ‘AI_CANONNAME’ undeclared (first use in this function)
hints.ai_flags = AI_CANONNAME;
^
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:81:25: note: each undeclared identifier is reported only once for each function it appears in
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:84:15: warning: implicit declaration of function ‘getaddrinfo’ [-Wimplicit-function-declaration]
errcode = getaddrinfo(hostname, portNum, &hints, &result);
^
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:89:63: error: dereferencing pointer to incomplete type ‘struct addrinfo’
printf("sending data to '%s' (IP : %s); port %d\n", result->ai_canonname,
^
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:132:9: warning: implicit declaration of function ‘freeaddrinfo’ [-Wimplicit-function-declaration]
freeaddrinfo(result);
^
/home/jhageman/cFS/cFS-GitHub/tools/cFS-GroundSystem/Subsystems/cmdUtil/SendUdp.c:55:25: warning: unused variable ‘hints’ [-Wunused-variable]
struct addrinfo hints;
^
To Reproduce
Steps to reproduce the behavior:
- add_definitions("-Wall -Wstrict-prototypes -std=c99 -pedantic -Wcast-align") to mission_build.cmake prepare function
- make prep and make
Expected behavior
Clean build
Code snips
N/A
System observed on:
- Hardware: cFS Dev Server
- OS: Ubuntu 16.04
- Versions: master bundle
Additional context
N/A
Reporter Info
Jacob Hageman - NASA/GSFC
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request