I'm trying to compile ArpON on an x86-64 Ubuntu 18.10 machine and it fails with :
arpon-code/src/opt.c: In function ‘opt_setinterface’:
arpon-code/src/opt.c:288:24: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
if (opt->interface != '\0')
^~
Reproduced by:
strykar@i-5:~/github/arpon-code$ git pull
Already up to date.
strykar@i-5:~/github/arpon-code$ mkdir build
strykar@i-5:~/github/arpon-code$ cd build/
strykar@i-5:~/github/arpon-code/build$ cmake ..
-- The C compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Building ArpON for Operating System: GNU/Linux
-- Build type: Release
-- Looking for net/ethernet.h
-- Looking for net/ethernet.h - found
-- Looking for net/if.h
-- Looking for net/if.h - found
-- Looking for net/if_arp.h
-- Looking for net/if_arp.h - found
-- Looking for netinet/ether.h
-- Looking for netinet/ether.h - found
-- Looking for netinet/if_ether.h
-- Looking for netinet/if_ether.h - found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/select.h
-- Looking for sys/select.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for getopt.h
-- Looking for getopt.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for time.h
-- Looking for time.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for assert.h
-- Looking for assert.h - found
-- Found library: Pthreads
-- Found library: Librt
-- Found library: Libpcap
-- Found library: Libnet1
-- Found library: Libdnet
-- Configuring done
-- Generating done
-- Build files have been written to: /home/strykar/github/arpon-code/build
strykar@i-5:~/github/arpon-code/build$ make
Scanning dependencies of target arpon
[ 5%] Building C object src/CMakeFiles/arpon.dir/arpca.c.o
[ 10%] Building C object src/CMakeFiles/arpon.dir/darpi.c.o
[ 15%] Building C object src/CMakeFiles/arpon.dir/darpica.c.o
[ 20%] Building C object src/CMakeFiles/arpon.dir/dmn.c.o
[ 25%] Building C object src/CMakeFiles/arpon.dir/env.c.o
[ 30%] Building C object src/CMakeFiles/arpon.dir/exit.c.o
[ 35%] Building C object src/CMakeFiles/arpon.dir/harpi.c.o
[ 40%] Building C object src/CMakeFiles/arpon.dir/intf.c.o
[ 45%] Building C object src/CMakeFiles/arpon.dir/ispn.c.o
[ 50%] Building C object src/CMakeFiles/arpon.dir/main.c.o
[ 55%] Building C object src/CMakeFiles/arpon.dir/msg.c.o
[ 60%] Building C object src/CMakeFiles/arpon.dir/opt.c.o
/home/strykar/github/arpon-code/src/opt.c: In function ‘opt_setinterface’:
/home/strykar/github/arpon-code/src/opt.c:288:24: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
if (opt->interface != '\0')
^~
/home/strykar/github/arpon-code/src/opt.c:288:9: note: did you mean to dereference the pointer?
if (opt->interface != '\0')
^
/home/strykar/github/arpon-code/src/opt.c: In function ‘opt_loop’:
/home/strykar/github/arpon-code/src/opt.c:224:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
exit_cleanup(true);
^~~~~~~~~~~~~~~~~~
/home/strykar/github/arpon-code/src/opt.c:226:13: note: here
case 'h':
^~~~
/home/strykar/github/arpon-code/src/opt.c:231:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
exit_cleanup(true);
^~~~~~~~~~~~~~~~~~
/home/strykar/github/arpon-code/src/opt.c:233:13: note: here
case '?':
^~~~
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/arpon.dir/build.make:206: src/CMakeFiles/arpon.dir/opt.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:155: src/CMakeFiles/arpon.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
strykar@i-5:~/github/arpon-code/build$
strykar@i-5:~/github/arpon-code/build$ cat log/cmake_install.cmake
# Install script for directory: /home/strykar/github/arpon-code/log
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Release")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xLogx" OR NOT CMAKE_INSTALL_COMPONENT)
list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
"/var/log/arpon.log")
if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
endif()
file(INSTALL DESTINATION "/var/log" TYPE FILE PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ FILES "/home/strykar/github/arpon-code/log/arpon.log")
endif()
strykar@i-5:~/github/arpon-code/build$
This is a duplicate ticket of #1 fix gcc-7 compile errors:
https://sourceforge.net/p/arpon/bugs/1/
So please look that ticket where you can find the patch (by Lukas Schwaighofer) that fix your errors.
Thanks