Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling on Fedora #215

Open
bkmgit opened this issue Jul 24, 2020 · 1 comment
Open

Error when compiling on Fedora #215

bkmgit opened this issue Jul 24, 2020 · 1 comment

Comments

@bkmgit
Copy link
Contributor

bkmgit commented Jul 24, 2020

Get the following errors when building on Fedora

/home/spindump/src/spindump_remote_server.c:160:0: style: The function 'spindump_remote_server_close' is never used. [unusedFunction]

^
/home/spindump/src/spindump_remote_server.c:189:0: style: The function 'spindump_remote_server_getupdate' is never used. [unusedFunction]

^
/home/spindump/src/spindump_remote_server.c:107:0: style: The function 'spindump_remote_server_init' is never used. [unusedFunction]

^
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingIncludeSystem]

/home/spindump/src/spindump_remote_server.c: In function ‘spindump_remote_server_init’:
/home/spindump/src/spindump_remote_server.c:139:37: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types]
139 | spindump_remote_server_answer, server,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t , void **) {aka int ()(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int , void **)}
In file included from /home/spindump/src/spindump_remote_server.h:26,
from /home/spindump/src/spindump_remote_server.c:32:
/usr/include/microhttpd.h:2425:1: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result (
)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int , void **)’} but argument is of type ‘int ()(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t , void **)’ {aka ‘int ()(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int , void **)’}
2425 | MHD_start_daemon (unsigned int flags,
| ^~~~~~~~~~~~~~~~
/home/spindump/src/spindump_remote_server.c: In function ‘spindump_remote_server_printparameters’:
/home/spindump/src/spindump_remote_server.c:356:58: error: passing argument 3 of ‘MHD_get_connection_values’ from incompatible pointer type [-Werror=incompatible-pointer-types]
356 | MHD_get_connection_values(connection, MHD_HEADER_KIND, spindump_remote_server_printparameter, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int (
)(void *, enum MHD_ValueKind, const char *, const char )
In file included from /home/spindump/src/spindump_remote_server.h:26,
from /home/spindump/src/spindump_remote_server.c:32:
/usr/include/microhttpd.h:2699:49: note: expected ‘MHD_KeyValueIterator’ {aka ‘enum MHD_Result (
)(void *, enum MHD_ValueKind, const char *, const char )’} but argument is of type ‘int ()(void *, enum MHD_ValueKind, const char *, const char )’
2699 | MHD_KeyValueIterator iterator,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/spindump/src/spindump_remote_server.c: In function ‘spindump_remote_server_answer’:
/home/spindump/src/spindump_remote_server.c:622:67: error: passing argument 3 of ‘MHD_create_post_processor’ from incompatible pointer type [-Werror=incompatible-pointer-types]
622 | spindump_remote_server_postiterator,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int (
)(void *, enum MHD_ValueKind, const char *, const char *, const char *, const char *, const char , uint64_t, size_t) {aka int ()(void *, enum MHD_ValueKind, const char *, const char *, const char *, const char *, const char , long unsigned int, long unsigned int)}
In file included from /home/spindump/src/spindump_remote_server.h:26,
from /home/spindump/src/spindump_remote_server.c:32:
/usr/include/microhttpd.h:3463:1: note: expected ‘MHD_PostDataIterator’ {aka ‘enum MHD_Result (
)(void *, enum MHD_ValueKind, const char *, const char *, const char *, const char *, const char , long unsigned int, long unsigned int)’} but argument is of type ‘int ()(void *, enum MHD_ValueKind, const char *, const char *, const char *, const char *, const char , uint64_t, size_t)’ {aka ‘int ()(void *, enum MHD_ValueKind, const char *, const char *, const char *, const char *, const char *, long unsigned int, long unsigned int)’}
3463 | MHD_create_post_processor (struct MHD_Connection *connection,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/benson/spindump/src/spindump_remote_server.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-documentation’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-reserved-id-macro’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-documentation-deprecated-sync’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-disabled-macro-expansion’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-covered-switch-default’ [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/spindumplib.dir/build.make:603: src/CMakeFiles/spindumplib.dir/spindump_remote_server.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:770: src/CMakeFiles/spindumplib.dir/all] Error 2
make: *** [Makefile:161: all] Error 2

@bkmgit
Copy link
Contributor Author

bkmgit commented Jul 24, 2020

The regular build command:

cmake .
make

gives the above error. When building using

cmake -DCMAKE_C_FLAGS="-Wall -Wpedantic -Wno-error=incompatible-pointer-types -Wno-incompatible-pointer-types" .
make

it successfully builds, but I get the following errors

spindump: error: cannot parse JSON record: missing opening brace in field top
spindump: error: cannot parse JSON record: missing opening brace in field top
spindump: error: cannot parse JSON string: missing opening quote in field b
spindump: error: field a is missing from the JSON record
spindump: error: cannot parse JSON string: missing opening quote in field array
spindump: warning: not enough bytes for the IPv6 header (capture length only 50, 54 required)
spindump: warning: not enough bytes for the IP header (capture length only 19, 34 required)
spindump: warning: not enough bytes for the IPv6 header (capture length only 21, 54 required)
spindump: warning: not enough bytes for the Ethernet header, only 12 bytes in received frame
spindump: warning: not enough payload bytes for an ICMPv6 header
spindump: warning: not enough payload bytes for an ICMP echo header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant