On CURRENT hosting poudriere (both, host and jail, running FreeBSD 12.0-CURRENT 1200056 amd64 with recent poudriere), building port comms/hylafax fails with the following error /usr/bin/c++ -O2 -pipe -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -Wall -L/usr/local/lib -fstack-protector -fno-strict-aliasing -D__ANSI_CPP__ -I. -I.. -I.././libhylafax -I.././libhylafax -I/usr/include -I/usr/local/include -c FaxConfig.c++ c++: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument] /usr/bin/c++ -O2 -pipe -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -Wall -L/usr/local/lib -fstack-protector -fno-strict-aliasing -D__ANSI_CPP__ -I. -I.. -I.././libhylafax -I.././libhylafax -I/usr/include -I/usr/local/include -c FaxRecvInfo.c++ c++: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument] In file included from FaxRecvInfo.c++:26: In file included from ./FaxRecvInfo.h:33: ./Class2Params.h:35:1: warning: 'Class2Params' defined as a class here but previously declared as a struct [-Wmismatched-tags] class Class2Params ^ ./FaxParams.h:32:1: note: did you mean class here? struct Class2Params; ^~~~~~ class FaxRecvInfo.c++:115:17: error: comparison between pointer and integer ('const char *' and 'int') while (cp+2 != '\0') { ~~~~ ^ ~~~~ 1 warning and 1 error generated. *** Error code 1
Created attachment 191117 [details] patch-libhylafax_FaxRecvInfo.c++
The patch works for me. Is it going to be commited?
The patch doesn't make sense. It restores the existing behavior but there must be a bug there. cp+2 will never be NULL (unless we wrap around the end of the address space). At first glance cp[2] != '\0' might have been intended, but I don't understand the overall logic.
Dmitry (Clang 6 guru/maintainer) may be able to shed light on the correct course of action from a C++ code point of view.
Created attachment 196063 [details] Fix bad pointer comparison Yeah, having looked at that routine, I'm of the opinion that it should be cp[2] != '\0'. Now I am going to rinse out my eyeballs with some soap, it is a miracle that this software works at all.
A commit references this bug: Author: koobs Date: Sun Oct 7 10:29:07 UTC 2018 New revision: 481438 URL: https://svnweb.freebsd.org/changeset/ports/481438 Log: comms/hylafax: Fix build with Clang 6 (and GCC7) Add patch from upstream HylaFAX+, fixing a Clang 6 (and GCC7) build error: FaxRecvInfo.c++:115:17: error: comparison between pointer and integer ('const char *' and 'int') while (cp+2 != '\0') { ~~~~ ^ ~~~~ [1] http://bugs.hylafax.org/show_bug.cgi?id=971 [2] https://sourceforge.net/p/hylafax/HylaFAX+/2417/ [3] See Also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853448 PR: 225372 Reported by: O. Hartmann <ohartmann walstatt org> Obtained from: HylaFAX+ [2] MFH: 2018Q4 Changes: head/comms/hylafax/Makefile head/comms/hylafax/files/patch-libhylafax_FaxRecvInfo.c++
A commit references this bug: Author: koobs Date: Mon Oct 8 08:53:59 UTC 2018 New revision: 481526 URL: https://svnweb.freebsd.org/changeset/ports/481526 Log: MFH: r481438 comms/hylafax: Fix build with Clang 6 (and GCC7) Add patch from upstream HylaFAX+, fixing a Clang 6 (and GCC7) build error: FaxRecvInfo.c++:115:17: error: comparison between pointer and integer ('const char *' and 'int') while (cp+2 != '\0') { ~~~~ ^ ~~~~ [1] http://bugs.hylafax.org/show_bug.cgi?id=971 [2] https://sourceforge.net/p/hylafax/HylaFAX+/2417/ [3] See Also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853448 PR: 225372 Reported by: O. Hartmann <ohartmann walstatt org> Obtained from: HylaFAX+ [2] Approved by: ports-secteam (miwi) Changes: _U branches/2018Q4/ branches/2018Q4/comms/hylafax/Makefile branches/2018Q4/comms/hylafax/files/patch-libhylafax_FaxRecvInfo.c++
Committed (using change obtained from upstream) and merged Thank you for your help everyone, apologies for the delay.