<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>309978</bug_id>
          
          <creation_ts>2026-03-15 02:36:17 -0700</creation_ts>
          <short_desc>[WPE][GTK] unsafe-buffer-usage-in-format-attr-call clang-22 warnings</short_desc>
          <delta_ts>2026-05-16 00:45:00 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>314914</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>314914</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Normand">philn</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2190383</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-03-15 02:36:17 -0700</bug_when>
    <thetext>With clang-22 a bunch of those are raised, example:

In file included from /var/home/phil/WebKit/Source/WTF/wtf/SystemTracing.h:207:
/var/home/phil/WebKit/Source/WTF/wtf/glib/SysprofAnnotator.h:54:9: warning: formatting function &apos;sysprof_collector_mark_vprintf&apos; is unsafe [-Wunsafe-buffer-usage-in-format-attr-call]
   54 |         sysprof_collector_mark_vprintf((sysprof_clock_get_current_time()), 0, m_processName, name.data(), description, args);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/SysprofAnnotator.h:54:107: note: string argument is not guaranteed to be null-terminated
   54 |         sysprof_collector_mark_vprintf((sysprof_clock_get_current_time()), 0, m_processName, name.data(), description, args);
      |                                                                                                           ^~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/SysprofAnnotator.h:62:9: warning: formatting function &apos;sysprof_collector_mark_vprintf&apos; is unsafe [-Wunsafe-buffer-usage-in-format-attr-call]
   62 |         sysprof_collector_mark_vprintf(time, 0, m_processName, name.data(), description, args);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/SysprofAnnotator.h:62:77: note: string argument is not guaranteed to be null-terminated
   62 |         sysprof_collector_mark_vprintf(time, 0, m_processName, name.data(), description, args);
      |                                                                             ^~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/SysprofAnnotator.h:104:13: warning: formatting function &apos;sysprof_collector_mark_vprintf&apos; is unsafe [-Wunsafe-buffer-usage-in-format-attr-call]
  104 |             sysprof_collector_mark_vprintf((sysprof_clock_get_current_time()), 0, m_processName, name.data(), description, args);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/SysprofAnnotator.h:104:111: note: string argument is not guaranteed to be null-terminated
  104 |             sysprof_collector_mark_vprintf((sysprof_clock_get_current_time()), 0, m_processName, name.data(), description, args);
      |                                                                                                               ^~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:108:75: warning: formatting function &apos;instantMark&apos; is unsafe [-Wunsafe-buffer-usage-in-format-attr-call]
  108 |             if (auto* annotator = SysprofAnnotator::singletonIfCreated()) annotator-&gt;instantMark(std::span(&quot;RunLoopSourceDispatch&quot;), &quot;&quot; &quot;[%s] lateness=%ldµs&quot;, g_source_get_name(source), lateness);
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/home/phil/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:108:161: note: string argument is not guaranteed to be null-terminated
  108 |             if (auto* annotator = SysprofAnnotator::singletonIfCreated()) annotator-&gt;instantMark(std::span(&quot;RunLoopSourceDispatch&quot;), &quot;&quot; &quot;[%s] lateness=%ldµs&quot;, g_source_get_name(source), lateness);
      |                                                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190384</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-03-15 02:57:58 -0700</bug_when>
    <thetext>What should we do? Add -Wno-unsafe-buffer-usage-in-format-attr-call in 3 CMakeLists.txt files or sprinkle hundreds of WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN/END calls all over the place?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190512</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2026-03-16 02:45:13 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #1)
&gt; What should we do? Add -Wno-unsafe-buffer-usage-in-format-attr-call in 3
&gt; CMakeLists.txt files or sprinkle hundreds of
&gt; WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN/END calls all over the place?

I would add the suppression macro covering the whole file, and later we can figure out
how to placate the warnings. Same as we did when initially adding the first compiler
flags for unsafe buffer warnings: suppress first, progressively burn them down later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190525</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-03-16 03:58:54 -0700</bug_when>
    <thetext>But these happen in quite a few third-party dependencies, I&apos;m not sure we can fix those. And also GST_DEBUG is used in dozens of our files :(

Is this warning really useful?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190527</commentid>
    <comment_count>4</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2026-03-16 04:11:31 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #3)
&gt; But these happen in quite a few third-party dependencies, I&apos;m not sure we
&gt; can fix those. And also GST_DEBUG is used in dozens of our files :(
&gt; 
&gt; Is this warning really useful?

We have WTF_IGNORE_WARNINGS_IN_THIRD_PARTY_CODE_{BEGIN,END} for
those cases. We add those markers before and after including the header(s)
that define the problematic functions/macros -- we use this for Skia headers
in a number of sources.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2211387</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-05-16 00:45:00 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 314914 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>