diff --git a/nas-1.9.5-No-implicit-ints-and-function-declarations.patch b/nas-1.9.5-No-implicit-ints-and-function-declarations.patch new file mode 100644 index 0000000..a3a7e50 --- /dev/null +++ b/nas-1.9.5-No-implicit-ints-and-function-declarations.patch @@ -0,0 +1,834 @@ +From 0e08ed6753a547637a39ede05a006d9b730647df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 22 Nov 2022 13:11:26 +0100 +Subject: [PATCH] No implicit ints and function declarations +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 13 or 14 is going to remove some old and by C99 standard obsolete +features, like implicit int types and implicit function declararations, +from an implicit gnu18 compilator standard. The compiler will report +an error instead: + +conftest.c:62:1: error: type defaults to 'int' in declaration of 'main' + 62 | main() + | ^~~~ +conftest.c:65:3: error: implicit declaration of function 'exit' + 65 | exit(0); + | ^~~~ + +This patch adjusts the code to remain compilable. For some functions, +it fixes their return type from int to void. Few functions which +apparantly are internal to a compilatation unit were made static. +_AuSendClientPrefix() was declared in a public header. + +Tested with an instrumented GCC 13.0.1. + + + +Signed-off-by: Petr Písař +--- + clients/audio/auctl/execute.c | 1 + + clients/audio/auplay/auplay.c | 1 + + clients/audio/examples/playFile.c | 1 + + config/configure.ac | 5 +- + config/filelist | 3 ++ + lib/audio/Alibint.h | 8 ++++ + lib/audio/ConnSvr.c | 3 ++ + server/dda/voxware/auvoxware.c | 3 +- + server/dda/voxware/config.c | 2 + + server/dia/au.h | 2 + + server/dia/gram.y | 1 + + server/include/access.h | 36 ++++++++++++++ + server/include/auth.h | 27 +++++++++++ + server/include/dix.h | 6 ++- + server/include/io.h | 29 ++++++++++++ + server/include/os.h | 2 + + server/os/access.c | 79 +++++++++++++++++-------------- + server/os/auth.c | 11 ++++- + server/os/connection.c | 23 +++++++-- + server/os/daemon.c | 4 ++ + server/os/io.c | 3 +- + server/os/mitauth.c | 2 + + server/os/osdep.h | 5 ++ + 23 files changed, 211 insertions(+), 46 deletions(-) + create mode 100644 server/include/access.h + create mode 100644 server/include/auth.h + create mode 100644 server/include/io.h + +diff --git a/clients/audio/auctl/execute.c b/clients/audio/auctl/execute.c +index 12f7c05..fd7a937 100644 +--- a/clients/audio/auctl/execute.c ++++ b/clients/audio/auctl/execute.c +@@ -22,6 +22,7 @@ + * $NCDId: @(#)execute.c,v 1.7 1994/04/07 18:10:33 greg Exp $ + */ + ++#include + #include "auctl.h" + + static int _execute_set PROTO((AuServer *, int, char **)); +diff --git a/clients/audio/auplay/auplay.c b/clients/audio/auplay/auplay.c +index 4037a64..c9d880e 100644 +--- a/clients/audio/auplay/auplay.c ++++ b/clients/audio/auplay/auplay.c +@@ -146,6 +146,7 @@ do_file(char *fname) + fprintf(stderr, "Couldn't play file \"%s\"\n", fname); + } + ++int + main(int argc, char **argv) + { + int i, +diff --git a/clients/audio/examples/playFile.c b/clients/audio/examples/playFile.c +index 646077e..e8828a8 100644 +--- a/clients/audio/examples/playFile.c ++++ b/clients/audio/examples/playFile.c +@@ -13,6 +13,7 @@ + #include