bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'daylight' redeclared as different kind of symbol with mingw-w64


From: markus . muetzel
Subject: Re: 'daylight' redeclared as different kind of symbol with mingw-w64
Date: Thu, 14 Nov 2024 17:33:06 +0000

Am 14. November 2024 um 18:22 schrieb "Markus Mützel":
> The following might be relevant:
> 
> configure:79124: checking spelling of daylight variable
> configure:79153: gcc -o conftest.exe -g -ggdb -O0 -pthread -fopenmp 
-fexceptions   conftest.c -lpthread -lm  >&5
> conftest.c: In function 'main':
> conftest.c:341:8: error: returning 'int * (*)(void)' from a function with 
return type 'int' makes integer from pointer without a cast [-Wint-conversion]
>   341 | return __daylight;
>       |        ^~~~~~~~~~
> configure:79153: $? = 1
> configure: failed program was:
&gt;  <snip>
&gt; | #include <time.h>
&gt; |
&gt; | #ifdef F77_DUMMY_MAIN
&gt; |
&gt; | #  ifdef __cplusplus
&gt; |      extern "C"
&gt; | #  endif
&gt; |    int F77_DUMMY_MAIN() { return 1; }
&gt; |
&gt; | #endif
&gt; | int
&gt; | main (void)
&gt; | {
&gt; | return __daylight;
&gt; |   ;
&gt; |   return 0;
&gt; | }
&gt; |
&gt; 
&gt; 
&gt; That is with GCC 14.2.0 if that matters.


With the following change in gnulib, it builds for me again. Again, I don't 
know if this is correct though.

diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 5f8c608271..216e590a2b 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -325,7 +325,7 @@ AC_DEFUN([gl_PREREQ_MKTIME], [
          [AC_LANG_PROGRAM(
             [[#include <time.h>
             ]],
-            [[return $gl_cv_var___daylight;]])
+            [[return (int) $gl_cv_var___daylight;]])
          ],
          [break])
      done])


</time.h></time.h></snip>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]