<?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>297946</bug_id>
          
          <creation_ts>2025-08-26 19:43:26 -0700</creation_ts>
          <short_desc>Enable format string attributes in Objective-C++ sources</short_desc>
          <delta_ts>2025-08-28 17:09:14 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>298071</blocked>
    
    <blocked>298073</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2138963</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2025-08-26 19:43:26 -0700</bug_when>
    <thetext>Remove hack that disables format string attributes in Objective-C++ sources.

This is the code that disables format string attributes in Source/WTF/wtf/Assertions.h:

```
#if COMPILER(GCC_COMPATIBLE) &amp;&amp; !defined(__OBJC__)
/* WTF logging functions can process %@ in the format string to log a NSObject* but the printf format attribute
   emits a warning when %@ is used in the format string.  Until &lt;rdar://problem/5195437&gt; is resolved we can&apos;t include
   the attribute when being used from Objective-C code in case it decides to use %@. */
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
#else
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments)
#endif
```

This is now fixable after this clang change from a few years ago:

&lt;https://github.com/llvm/llvm-project/commit/91ed7e19418181ae385c2626cedd3b08b6ba43a6&gt;

We can introduce a new attribute and a separate logging function that uses the attribute so the compiler is able to verify placeholders correctly:

__attribute__((__format__(__NSString__, format, vaargs)))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138964</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-08-26 19:43:47 -0700</bug_when>
    <thetext>&lt;rdar://problem/159245047&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138968</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2025-08-26 20:06:08 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/49918</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2139248</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-08-27 20:44:33 -0700</bug_when>
    <thetext>Committed 299238@main (1c37850168d7): &lt;https://commits.webkit.org/299238@main&gt;

Reviewed commits have been landed. Closing PR #49918 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>