SV: [PATCH] libgccjit: add some reflection functions in the jit C api

Petter Tomner tomner@kth.se
Sat Nov 27 16:09:51 GMT 2021


> My regular testers are x86-64 and do not show this, but if I'm right it should also should on 32-bit GNU/Linux?

Ye it is supposed to compile cleanly for 32bit too. 

I pushed a patch for it as a "free for all". With %zu specifiers. I hope @dmalcolm is OK with it?

Regards,

Från: Gcc-patches <gcc-patches-bounces+tomner=kth.se@gcc.gnu.org> för Gerald Pfeifer <gerald@pfeifer.com>
Skickat: den 26 november 2021 19:03
Till: David Malcolm; Antoni Boucher; Antoni Boucher via Jit
Kopia: gcc-patches@gcc.gnu.org
Ämne: Re: [PATCH] libgccjit: add some reflection functions in the jit C api
    
On Fri, 19 Nov 2021, David Malcolm via Gcc-patches wrote:
> On Mon, 2021-09-27 at 20:53 -0400, Antoni Boucher wrote:
>> I fixed an issue (it would show an error message when
>> gcc_jit_type_dyncast_function_ptr_type was called on a type different
>> than a function pointer type).
> The updated patch is good for trunk, assuming you re-ran the regression 
> tests successfully.

I have received a report of GCC builds now failing on FreeBSD/i386:

In function 'gcc_jit_type*
gcc_jit_function_type_get_param_type(gcc_jit_function_type*, size_t)':
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20211121/gcc/jit/libgccjit.c:
184:35: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
  184 |         jit_error ((CTXT), (LOC), "%s: " ERR_FMT, \
      |                                   ^
  185 |                    __func__, (A0), (A1), (A2));                 \
      |                              ~~~~  
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20211121/gcc/jit/libgccjit.c:
230:3: note: in expansion of macro 'RETURN_VAL_IF_FAIL_PRINTF3'
  230 |   RETURN_VAL_IF_FAIL_PRINTF3 (TEST_EXPR, NULL, CTXT, LOC, ERR_FMT, A0, A1, A2)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20211121/gcc/jit/libgccjit.c: 708:3: note: in expansion of macro 'RETURN_NULL_IF_FAIL_PRINTF3'
  708 |   RETURN_NULL_IF_FAIL_PRINTF3 (index < num_params,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20211121/gcc/jit/libgccjit.c: 710:44: note: format string is defined here
  710 |                                "index of %ld is too large (%s has %ld params)",
      |                                          ~~^
      |                                            |
      |                                            long int 
      |                                          %d
/wrkdirs/usr/ports/lang/gcc12-devel/work/gcc-12-20211121/gcc/jit/libgccjit.c:
184:35: error: format '%ld' expects argument of type 'long int', but argument 7 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]


My regular testers are x86-64 and do not show this, but if I'm right
it should also should on 32-bit GNU/Linux?

Gerald
    


More information about the Jit mailing list