Xcode 9 build failure for sfk 1.8.8
One hundred command line tools in a small and portable binary.
Brought to you by:
stahlworks
macOS 10.13.1
Xcode: 9.1
CLT: 9.1.0.0.1.1508540944
==> make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
depbase=`echo sfk.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
clang++ -DHAVE_CONFIG_H -I. -g -O2 -MT sfk.o -MD -MP -MF $depbase.Tpo -c -o sfk.o sfk.cpp &&\
mv -f $depbase.Tpo $depbase.Po
sfk.cpp:42880:55: error: ordered comparison between pointer and zero ('char *' and 'int')
if (fgets(szLineBuf, MAX_LINE_LEN, stdin) <= 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.
make[1]: *** [sfk.o] Error 1
make: *** [all] Error 2
Here is a patch:
diff --git a/sfk.cpp b/sfk.cpp
index a433e52..6646024 100644
--- a/sfk.cpp
+++ b/sfk.cpp
@@ -42877,7 +42877,7 @@ int submain(int argc, char *argv[], char *penv[], char *pszCmd, int iDir, bool &
if (!ptext)
break;
} else {
- if (fgets(szLineBuf, MAX_LINE_LEN, stdin) <= 0)
+ if (fgets(szLineBuf, MAX_LINE_LEN, stdin) <= (void *)0)
break;
removeCRLF(szLineBuf);
ptext = szLineBuf;
the line will be fixed in the next update as: