Skip to content

Commit

Permalink
man: fix C99 implicit int errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rswail authored Feb 5, 2025
1 parent 7e0b5e5 commit 7589b30
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sysutils/man/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ patchfiles configure-DEF_NLSPATH.patch \
src__man-getopt.c.diff \
src__man.c.diff \
src__manpath.c.diff \
src__util.c.diff
src__util.c.diff \
patch-int-main.diff

configure.universal_args-delete --disable-dependency-tracking

Expand Down
65 changes: 65 additions & 0 deletions sysutils/man/files/patch-int-main.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
--- configure.orig 2025-02-05 18:18:26.282384940 +1100
+++ configure 2025-02-05 18:19:18.847823147 +1100
@@ -225,7 +225,7 @@
echo checking for ANSI C header files
echo "#include <stdlib.h>
#include <string.h>
-main() { exit(0); strerror(0); }" > conftest.c
+int main() { exit(0); strerror(0); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
DEFS="$DEFS -DSTDC_HEADERS"
@@ -239,7 +239,7 @@
echo checking for sys/termios.h
echo "#include <sys/termios.h>
#include <stdlib.h>
-main() { exit(0); }" > conftest.c
+int main() { exit(0); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
DEFS="$DEFS -DTERMIOS_HEADER"
@@ -249,7 +249,7 @@
echo checking for POSIX.1 header files
echo "#include <unistd.h>
#include <stdlib.h>
-main() {
+int main() {
#ifdef _POSIX_VERSION
exit(0);
#else
@@ -265,7 +265,7 @@
echo checking for BSD string and memory functions
echo "#include <strings.h>
#include <stdlib.h>
-main() { exit(0); rindex(0, 0); bzero(0, 0); }" > conftest.c
+int main() { exit(0); rindex(0, 0); bzero(0, 0); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else DEFS="$DEFS -DUSG"
@@ -275,7 +275,7 @@
echo checking whether sys/types.h defines uid_t
echo '#include <sys/types.h>
#include <stdlib.h>
-main() { uid_t x; exit(0); }' > conftest.c
+int main() { uid_t x; exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
@@ -309,7 +309,7 @@
#endif
#endif
#endif
-main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c
+int main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
elif test -d /usr/ucblib; then LIBS="$LIBS -L/usr/ucblib -lucb"
@@ -341,7 +341,7 @@
#include <stdio.h>
#include <stdlib.h>
struct option long_opts[] = { { "", no_argument, NULL, 0 } };
-main() { exit(0); }' > conftest.c
+int main() { exit(0); }' > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
manpathoption="--path"

0 comments on commit 7589b30

Please sign in to comment.