bplaum / gmerlin

Multimedia architecture and applications
GNU General Public License v2.0
0 stars 1 forks source link

m4 tests are not valid C99 #11

Closed umlaeute closed 1 month ago

umlaeute commented 3 months ago

m4/check_funcs.m4 is full of code like the following:

https://github.com/bplaum/gmerlin/blob/c58dee142d20038291c0d802d5d4f43daeae1ba2/m4/check_funcs.m4#L1714-L1716

while this is valid K&R code (and up to C90), but it is no longer valid in C99, and recent compilers (notably gcc-14 error out on such code. as a consequence, the configure tests fail when they shouldnt.

i suggest replacing the main lines with int main instead:

--- gmerlin.orig/m4/check_funcs.m4
+++ gmerlin/m4/check_funcs.m4
@@ -882,7 +882,7 @@
   AC_TRY_RUN([
     #include <FLAC/stream_decoder.h>
     #include <stdio.h>
-    main()
+    int main()
     {
     FILE * version_file;
     int version_major;
@@ -1041,7 +1041,7 @@
   AC_TRY_RUN([
     #include "mad.h"
     #include <stdio.h>
-    main()
+    int main()
     {
     struct mad_stream stream;
     int version_major = MAD_VERSION_MAJOR;
@@ -1356,7 +1356,7 @@
   AC_TRY_RUN([
     #include <lame/lame.h>
     #include <stdio.h>
-    main()
+    int main()
     {
     int version_major;
     int version_minor;
@@ -1437,7 +1437,7 @@
 AC_TRY_RUN([
     #include <inttypes.h>
     #include <faac.h>
-    main()
+    int main()
     {
     int samplerate = 44100, num_channels = 2;
     unsigned long input_samples, output_bytes;
@@ -1712,7 +1712,7 @@
     #include <semaphore.h>

     #include <stdio.h>
-    main()
+    int main()
     {
     int result;
     sem_t s;
bplaum commented 1 month ago

Fixed