Hi Iain,

> Darwin is host-shared by default, and therefore builds jit for 
> —enable-languages=all.
>
> The changes in r16-4527-gc11d9eaa8ac9ee are causing format mismatches on 
> lines 3433 and 3449 of jit-recording.cc <http://jit-recording.cc/> because 
> Darwin’s uint64_t == long long unsigned int (and the format specifiers are 
> %ld and %li).
>
> It seems I cannot locate the post(s) about review of this patch on 
> gcc-patches@ …
>
> Anyway, it’s not obvious to me whether for format specifiers need to be 
> changed, or the passed value needs to be casted (I have temporarily done the 
> second to make progress).
>
> please could you take a look - or, if the second action is correct, let me 
> know and I’ll push that fix,

I've seen this myself and believe the following patch is the correct way
to print uint64_t, as is done in many other places.  It passes
bootstrap on x86_64-apple-darwin25.0.0 and several earlier versions.

I won't be able to commit it myself if approved since I'm about to leave
for vacation soon.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
--- a/gcc/jit/jit-recording.cc
+++ b/gcc/jit/jit-recording.cc
@@ -3430,7 +3430,7 @@ recording::string *
 recording::array_type::make_debug_string ()
 {
   return string::from_printf (m_ctxt,
-			      "%s[%ld]",
+			      "%s[%" PRIu64 "]",
 			      m_element_type->get_debug_string (),
 			      m_num_elements);
 }
@@ -3446,7 +3446,7 @@ recording::array_type::write_reproducer 
 	   "    gcc_jit_context_new_array_type_u64 (%s,\n"
 	   "                                        %s, /* gcc_jit_location *loc */\n"
 	   "                                        %s, /* gcc_jit_type *element_type */\n"
-	   "                                        %li); /* int num_elements */\n",
+	   "                                        %" PRIu64 "); /* int num_elements */\n",
 	   id,
 	   r.get_identifier (get_context ()),
 	   r.get_identifier (m_loc),

Reply via email to