Module: Mesa
Branch: main
Commit: 031978933151e95690e93919e7bfd9f1753f2794
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=031978933151e95690e93919e7bfd9f1753f2794

Author: Florian Weimer <fwei...@redhat.com>
Date:   Mon Jan  8 13:29:57 2024 +0100

meson: C type error in strtod_l/strtof_l probe

Future compilers will fail compilation due to the C type error:

…/testfile.c: In function 'main':
…/testfile.c:12:30: error: passing argument 2 of 'strtod_l' from incompatible 
pointer type
   12 |       double d = strtod_l(s, end, loc);
      |                              ^~~
      |                              |
      |                              char *
/usr/include/stdlib.h:416:43: note: expected 'char ** restrict' but argument is 
of type 'char *'
  416 |                         char **__restrict __endptr, locale_t __loc)
      |                         ~~~~~~~~~~~~~~~~~~^~~~~~~~
…/testfile.c:13:29: error: passing argument 2 of 'strtof_l' from incompatible 
pointer type
   13 |       float f = strtof_l(s, end, loc);
      |                             ^~~
      |                             |
      |                             char *
/usr/include/stdlib.h:420:42: note: expected 'char ** restrict' but argument is 
of type 'char *'
  420 |                        char **__restrict __endptr, locale_t __loc)
      |                        ~~~~~~~~~~~~~~~~~~^~~~~~~~


This means that the probe no longer tests is objective and always
fails.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26927>

---

 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 6bbe203b5a4..ef6bd565bbd 100644
--- a/meson.build
+++ b/meson.build
@@ -1455,8 +1455,8 @@ if cc.links('''
       locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL);
       const char *s = "1.0";
       char *end;
-      double d = strtod_l(s, end, loc);
-      float f = strtof_l(s, end, loc);
+      double d = strtod_l(s, &end, loc);
+      float f = strtof_l(s, &end, loc);
       freelocale(loc);
       return 0;
     }''',

Reply via email to