Re: weird compiler error in 13.3-R
- In reply to: Paul Procacci : "Re: weird compiler error in 13.3-R"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Mar 2024 01:44:25 UTC
The problem is not type conversion issue described in compiling message . If the problem is a conversion issue, then it is easy to fix in coding. The problem is compiler treated va_list as unsigned in in line 119, then treated va_list as a structure pointer. This looks like a compiler bug. +hackers to see if someone knows what happened in the new compiler. -Jin On 3/10/24 00:43, Paul Procacci wrote: > 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}; > > > > > -- > __________________ > > :(){ :|:& };: