Re: weird compiler error in 13.3-R

From: Paul Procacci <pprocacci_at_gmail.com>
Date: Sun, 10 Mar 2024 08:43:55 UTC
https://reviews.llvm.org/D129881

The author of the change can explain it better than anyone else here.

~Paul

On Sun, Mar 10, 2024 at 4:24 AM Jin Guojun[VFF] <jguojun@gmail.com> wrote:

> 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};
>
>
>

-- 
__________________

:(){ :|:& };: