Mailing list archives : pcb-rnd

ID:5883
From:Florian Weimer <fw...@redhat.com>
Date:Mon, 05 Dec 2022 13:40:06 +0100
Subject:[pcb-rnd] Patches for improved C99 compatibility
replies: 5884 from rn...@igor2.repo.hu
--=-=-=
Content-Type: text/plain
 
Fedora is trying to build the distribution with a compiler that rejects
more historic C constructs that are no longer present in C99:
 
  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
 
For pcb-rnd, this alters the outcome of its autoconf-style checks.
There is also an implicit int.
 
The attached patches fix these issues.  There are still implicit
function declarations in probing for ioctl and gethostname, but the
logic eventually picks up the <sys/ioctl.h> and <unistd.h> headers,
these headers are just not probed first.
 
Thanks,
Florian
 
--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=pcb-rnd-librnd-scconfig-c99.patch
 
Avoid implicit function declarations in configure-style tests
by including additional header files.
 
diff --git a/src_3rd/librnd-local/scconfig/src/default/find_cc.c b/src_3rd/librnd-local/scconfig/src/default/find_cc.c
index 83adf40d7040603c..70457c679d7f2ab5 100644
--- a/src_3rd/librnd-local/scconfig/src/default/find_cc.c
+++ b/src_3rd/librnd-local/scconfig/src/default/find_cc.c
@@ -1070,6 +1070,7 @@ int find__exit(const char *name, int logdepth, int fatal)
 {
 	const char *test_c =
 		NL "#include <stdio.h>"
+		NL "#include <unistd.h>"
 		NL "int main() {"
 		NL "	_exit(0);"
 		NL "	puts(\"BAD\");"
diff --git a/src_3rd/librnd-local/scconfig/src/gui/find_x.c b/src_3rd/librnd-local/scconfig/src/gui/find_x.c
index ba50150c521bbc86..09f72ec1537b5584 100644
--- a/src_3rd/librnd-local/scconfig/src/gui/find_x.c
+++ b/src_3rd/librnd-local/scconfig/src/gui/find_x.c
@@ -69,6 +69,7 @@ int find_xinerama(const char *name, int logdepth, int fatal)
 {
 	const char *test_c =
 		NL "#include <X11/Xlib.h>"
+		NL "#include <X11/extensions/Xinerama.h>"
 		NL "#include <stdlib.h>"
 		NL "int main()"
 		NL "{"
diff --git a/src_3rd/librnd-local/scconfig/src/socket/find_socket.c b/src_3rd/librnd-local/scconfig/src/socket/find_socket.c
index 46ce640c4ee02801..d9dea7564a6108f7 100644
--- a/src_3rd/librnd-local/scconfig/src/socket/find_socket.c
+++ b/src_3rd/librnd-local/scconfig/src/socket/find_socket.c
@@ -741,6 +741,7 @@ int find_socket_readwrite(const char *name, int logdepth, int fatal)
 		NL ;
 
 	char *inc_linux =
+		NL "#include <unistd.h>"
 		NL;
 
 	char *inc_dns;
 
--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=pcb-rnd-librnd-implicit-int.patch
 
Fix typo anyload_conf_update(vpod) for anyload_conf_update(void).
 
diff --git a/src_3rd/librnd-local/src/librnd/core/anyload.c b/src_3rd/librnd-local/src/librnd/core/anyload.c
index 1c8ba63f565d9cc3..cdf5a6f97beefac3 100644
--- a/src_3rd/librnd-local/src/librnd/core/anyload.c
+++ b/src_3rd/librnd-local/src/librnd/core/anyload.c
@@ -276,7 +276,7 @@ int rnd_anyload_parse_root(rnd_hidlib_t *hidlib, lht_node_t *root, const char *c
 
 int rnd_anyload_conf_needs_update = 0;
 static int al_conf_inhibit;
-static void anyload_conf_update(vpod)
+static void anyload_conf_update(void)
 {
 	if (al_conf_inhibit || !rnd_anyload_conf_needs_update)
 		return;
 
--=-=-=--
 
 

Reply subtree:
5883 [pcb-rnd] Patches for improved C99 compatibility from Florian Weimer <fw...@redhat.com>
  5884 Re: [pcb-rnd] Patches for improved C99 compatibility from rn...@igor2.repo.hu