chiark / gitweb /
Provide proper declarations of functions
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Aug 2024 21:43:45 +0000 (22:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Aug 2024 21:43:45 +0000 (22:43 +0100)
Fixes the build with C99 / GCC-14.

Closes: #1075632
gram.y
parse.c
regions.c

diff --git a/gram.y b/gram.y
index ac414120d5af622dedc3e843ef7aeab7b0dd97fb..6375e3f2d318efba11deded1dd63acc393940c67 100644 (file)
--- a/gram.y
+++ b/gram.y
@@ -118,6 +118,14 @@ extern int SetSound();
  */
 extern int yylineno;
 
+/*
+ * yylex must be declared in C99.  GCC 14 doesn't like it without.
+ *
+ * This thread is of some interest
+ *   https://lists.gnu.org/r/bug-bison/2022-01/msg00002.html
+ */
+extern int yylex();
+
 %}
 
 %union
diff --git a/parse.c b/parse.c
index 050794af742dca92de0774530ae0f7dcad6b073a..0d9223a071a818053d0573b6408155fcf472fe81 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -370,6 +370,7 @@ void twmUnput (c)
 
 void
 TwmOutput(c)
+    int c;
 {
     putchar(c);
 }
index 1067f1ce81440ba7cf9d66888aaa3b12cf939edf..4a74cb27546a8d2c1e8408cc72afe4fd71d8a554 100644 (file)
--- a/regions.c
+++ b/regions.c
@@ -99,6 +99,8 @@ splitRegionEntry (re, grav1, grav2, w, h)
 
 int
 roundEntryUp (v, multiple)
+    int v;
+    int multiple;
 {
     return ((v + multiple - 1) / multiple) * multiple;
 }