<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 95be247b9dd24a870905da9f8238ffcc6800732d Mon Sep 17 00:00:00 2001
From: Adam Sampson &lt;ats@offog.org&gt;
Date: Fri, 11 Jul 2025 13:25:36 +0100
Subject: [PATCH 1/5] Fix Configure tests for modern C

Always specify return types for functions.

Avoid using exit, which requires &lt;stdlib.h&gt; on a modern compiler.

Provide a prototype in the glibc test; glibc needs an ANSI compiler
anyway.
---
 Configure | 45 +++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/Configure b/Configure
index 87e16cd..ac6c1e7 100755
--- a/Configure
+++ b/Configure
@@ -2078,7 +2078,7 @@ int main() {
 	printf("%s\n", "1");
 #endif
 #endif
-	exit(0);
+	return 0;
 }
 EOM
 if $cc -o gccvers gccvers.c &gt;/dev/null 2&gt;&amp;1; then
@@ -2560,7 +2560,7 @@ and I got the following output:
 EOM
 $cat &gt; try.c &lt;&lt;'EOF'
 #include &lt;stdio.h&gt;
-main() { exit(0); }
+int main() { return 0; }
 EOF
 dflt=y
 if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" &gt;&gt;try.msg 2&gt;&amp;1; then
@@ -2746,8 +2746,8 @@ esac'
 echo " "
 echo "Checking for GNU C Library..." &gt;&amp;4
 cat &gt;gnulibc.c &lt;&lt;EOM
-int
-main()
+extern void __libc_main(void);
+int main()
 {
 	return __libc_main();
 }
@@ -3113,7 +3113,8 @@ yes)
 		else tval=false;
 		fi;;
 	*)
-		echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" &gt; t.c;
+		echo "#include &lt;stdio.h&gt;" &gt; t.c;
+		echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" &gt;&gt; t.c;
 		if $cc $ccflags $ldflags -o t t.c $libs &gt;/dev/null 2&gt;&amp;1;
 		then tval=true;
 		else tval=false;
@@ -3234,8 +3235,8 @@ case "$d_access" in
 #ifdef I_UNISTD
 #include &lt;unistd.h&gt;
 #endif
-main() {
-	exit(R_OK);
+int main() {
+	return R_OK;
 }
 EOCP
 	: check sys/file.h first, no particular reason here
@@ -3285,7 +3286,7 @@ echo " "
 echo 'Checking to see if your C compiler knows about "const"...' &gt;&amp;4
 $cat &gt;const.c &lt;&lt;'EOCP'
 typedef struct spug { int drokk; } spug;
-main()
+int main()
 {
 	const char *foo;
 	const spug y;
@@ -3552,12 +3553,12 @@ $cat &gt;open3.c &lt;&lt;'EOCP'
 #ifdef I_SYS_FILE
 #include &lt;sys/file.h&gt;
 #endif
-main() {
+int main() {
 	if(O_RDONLY);
 #ifdef O_TRUNC
-	exit(0);
+	return 0;
 #else
-	exit(1);
+	return 1;
 #endif
 }
 EOCP
@@ -3608,7 +3609,7 @@ eval $inlibc
 echo " "
 echo 'Checking to see if your C compiler knows about "volatile"...' &gt;&amp;4
 $cat &gt;try.c &lt;&lt;'EOCP'
-main()
+int main()
 {
 	typedef struct _goo_struct goo_struct;
 	goo_struct * volatile goo = ((goo_struct *)0);
@@ -3656,7 +3657,7 @@ case "$voidflags" in
 #if TRY &amp; 1
 void sub() {
 #else
-sub() {
+int sub() {
 #endif
 	extern void moo();	/* function returning void */
 	void (*goo)();		/* ptr to func returning void */
@@ -3669,12 +3670,12 @@ sub() {
 
 #if TRY &amp; 4
 	if(goo == moo) {
-		exit(0);
+		sub();
 	}
 #endif
-	exit(0);
+	sub();
 }
-main() { sub(); }
+int main() { sub(); }
 EOCP
 	if $cc $ccflags -c -DTRY=$defvoidused try.c &gt;.out 2&gt;&amp;1 ; then
 		voidflags=$defvoidused
@@ -4050,8 +4051,8 @@ $rm -f dep.c dep.h dep$_o dep.out
 echo " "
 echo "Checking out function prototypes..." &gt;&amp;4
 $cat &gt;prototype.c &lt;&lt;'EOCP'
-main(int argc, char *argv[]) {
-	exit(0);}
+int main(int argc, char *argv[]) {
+	return 0;}
 EOCP
 if $cc $ccflags -c prototype.c &gt;prototype.out 2&gt;&amp;1 ; then
 	echo "Your C compiler appears to support function prototypes."
@@ -4398,7 +4399,7 @@ $cat &gt;try.c &lt;&lt;'EOCP'
 #ifdef I_SYSSELECT
 #include &lt;sys/select.h&gt;
 #endif
-main()
+int main()
 {
 	struct tm foo;
 #ifdef S_TIMEVAL
@@ -4408,12 +4409,12 @@ main()
 	struct timezone tzp;
 #endif
 	if (foo.tm_sec == foo.tm_sec)
-		exit(0);
+		return 0;
 #ifdef S_TIMEVAL
 	if (bar.tv_sec == bar.tv_sec)
-		exit(0);
+		return 0;
 #endif
-	exit(1);
+	return 1;
 }
 EOCP
 flags=''
-- 
2.50.1

From 0524b627e02e65b2c9e43d905026f20878dde0c8 Mon Sep 17 00:00:00 2001
From: Adam Sampson &lt;ats@offog.org&gt;
Date: Fri, 11 Jul 2025 13:32:52 +0100
Subject: [PATCH 2/5] Include &lt;unistd.h&gt; rather than prototyping getopt

There's a bundled getopt implementation in libc/, so the intention was
probably to allow the use of that instead - but there's no support for
doing that in Configure any more.
---
 c2man.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/c2man.c b/c2man.c
index 0250d11..b9d0aae 100644
--- a/c2man.c
+++ b/c2man.c
@@ -24,11 +24,7 @@
 
 #include &lt;sys/stat.h&gt;
 #include &lt;signal.h&gt;
-
-/* getopt declarations */
-extern int getopt();
-extern char *optarg;
-extern int optind;
+#include &lt;unistd.h&gt;
 
 /* lex declarations */
 extern FILE *yyin;	/* lex input stream */
-- 
2.50.1

From 5cc64449b581858169cd23546901fa3cea53e7e2 Mon Sep 17 00:00:00 2001
From: Adam Sampson &lt;ats@offog.org&gt;
Date: Fri, 11 Jul 2025 13:33:48 +0100
Subject: [PATCH 3/5] Correct signal handler prototype

---
 c2man.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c2man.c b/c2man.c
index b9d0aae..39292d7 100644
--- a/c2man.c
+++ b/c2man.c
@@ -360,7 +360,7 @@ usage ()
 /* name of the temporary file; kept here so we can blast it if hit with ctrl-C
  */
 static char temp_name[20];
-Signal_t (*old_interrupt_handler)();
+Signal_t (*old_interrupt_handler)_((int));
 
 /* ctrl-C signal handler for use when we have a temporary file */
 static Signal_t interrupt_handler(sig)
-- 
2.50.1

From 9e70a0f6f3a51148d450c9fb831148838fa97332 Mon Sep 17 00:00:00 2001
From: Adam Sampson &lt;ats@offog.org&gt;
Date: Fri, 11 Jul 2025 13:35:18 +0100
Subject: [PATCH 4/5] Fix missing prototypes for internal functions

---
 html.c     | 1 +
 semantic.h | 5 +++++
 texinfo.c  | 1 +
 3 files changed, 7 insertions(+)

diff --git a/html.c b/html.c
index 4fc4112..97fc2e1 100644
--- a/html.c
+++ b/html.c
@@ -4,6 +4,7 @@
 #include "c2man.h"
 #include "manpage.h"
 #include "output.h"
+#include "semantic.h"
 #include &lt;ctype.h&gt;
 
 static int html_in_code = 0;
diff --git a/semantic.h b/semantic.h
index 6518dd4..932920a 100644
--- a/semantic.h
+++ b/semantic.h
@@ -65,6 +65,10 @@ extern Declarator * new_declarator _((
 extern void free_declarator _((
 	Declarator *d
 	));
+extern int comment_last_decl _((
+	DeclaratorList *list,
+	char *comment
+	));
 extern void new_decl_list _((
 	DeclaratorList *decl_list,
 	Declarator *declarator
@@ -119,3 +123,4 @@ void declarator_error _((Declarator *decl));
 
 boolean has_parameters _((const Declarator *d));
 boolean is_function_declarator _((const Declarator *d));
+boolean is_numbered _((const char *text));
diff --git a/texinfo.c b/texinfo.c
index 1b464b6..810ff04 100644
--- a/texinfo.c
+++ b/texinfo.c
@@ -4,6 +4,7 @@
 #include "c2man.h"
 #include "manpage.h"
 #include "output.h"
+#include "semantic.h"
 #include &lt;ctype.h&gt;
 
 static char *heading_not_in_contents[] =
-- 
2.50.1

From 7e9965aca5a07373e014f8cba2eb51cee889327d Mon Sep 17 00:00:00 2001
From: Adam Sampson &lt;ats@offog.org&gt;
Date: Fri, 11 Jul 2025 13:35:26 +0100
Subject: [PATCH 5/5] Avoid implicitly typing a variable as int

---
 texinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/texinfo.c b/texinfo.c
index 810ff04..af4138a 100644
--- a/texinfo.c
+++ b/texinfo.c
@@ -205,7 +205,7 @@ const char *filename;
 
 void texinfo_file_end() { put_string("@bye\n"); }
 
-static first_name = 1;
+static int first_name = 1;
 void texinfo_name(name)
 const char *name;
 {
-- 
2.50.1

</pre></body></html>