Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2024 00:24:16 -0800
From:      "Jin Guojun[VFF]" <jguojun@gmail.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   weird compiler error in 13.3-R
Message-ID:  <4d6edaa6-237d-4207-9047-ddee78ee4b90@gmail.com>

next in thread | raw e-mail | index | archive | help
Updated 13.2 to 13.3 and get a weird compiling failure. The code 
compiled since FreeBSD release 4 till release 13.2.

Both ap (line 119) and vap (line 126) are declared as va_list, somehow 
clang version 17.0.6 thinks va_list at line 119 is uint,

where va_list in line 126 is 'struct __va_list_tag *'.

Checked /usr/include and va_list is declared in 
/usr/include/sys/_stdarg.h:39:  typedef __va_list       va_list;
included by /usr/include/stdarg.h via x86/stdarg.h

  Does anyone have ideas on what could cause such compiling failure?

-Jin

     10 #include <stdarg.h>
      11 #include <stdio.h>

     118 struct  a_build_ctrl_t  {
     119         va_list         ap;     /* what is different from vap 
at line 126?    */
     120         argu_type       last_arg_t;
     121 };
     124
     125 arg_fmt_lists*
     126 build_arg_fmt_list(arg_fmt_list_string* fmt, va_list vap)
     127 {
     128     int     na=1;
     129
     130      arg_fmt_lists* aflp;
     131      arg_fmt_lists* aflp_top;
     132
     133     struct a_build_ctrl_t   abc = {.ap=vap, 
.last_arg_t=ARGU_NONE};

  ...

       }

test.c:133:34: error: incompatible pointer to integer conversion 
initializing 'unsigned int' with an expression of type 'struct 
__va_list_tag *' [-Wint-conversion]
   133 | struct a_build_ctrl_t   abc = {.ap=vap, .last_arg_t=ARGU_NONE};




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4d6edaa6-237d-4207-9047-ddee78ee4b90>