Title: [285102] trunk/Source/ThirdParty/ANGLE
Revision
285102
Author
ddkil...@apple.com
Date
2021-11-01 06:17:55 -0700 (Mon, 01 Nov 2021)

Log Message

[ANGLE] Enable -Wformat=2 warnings
<https://webkit.org/b/232358>
<rdar://problem/84568935>

Reviewed by Kimmo Kinnunen.

* Configurations/Base.xcconfig:
(WARNING_CFLAGS):
- Add -Wformat=2 switch, which includes -Wformat-nonliteral.
* src/common/angleutils.h:
(FormatStringIntoVector):
- Move below definition of ANGLE_FORMAT_PRINTF() and add macro
  to the function declaration to fix -Wformat-nonliteral
  warning.
* src/compiler/translator/Common.h:
(sh::str):
- Make `formatStr` a constexpr to fix -Wformat-nonliteral
  warning.

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (285101 => 285102)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-11-01 08:42:19 UTC (rev 285101)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-11-01 13:17:55 UTC (rev 285102)
@@ -1,3 +1,24 @@
+2021-11-01  David Kilzer  <ddkil...@apple.com>
+
+        [ANGLE] Enable -Wformat=2 warnings
+        <https://webkit.org/b/232358>
+        <rdar://problem/84568935>
+
+        Reviewed by Kimmo Kinnunen.
+
+        * Configurations/Base.xcconfig:
+        (WARNING_CFLAGS):
+        - Add -Wformat=2 switch, which includes -Wformat-nonliteral.
+        * src/common/angleutils.h:
+        (FormatStringIntoVector):
+        - Move below definition of ANGLE_FORMAT_PRINTF() and add macro
+          to the function declaration to fix -Wformat-nonliteral
+          warning.
+        * src/compiler/translator/Common.h:
+        (sh::str):
+        - Make `formatStr` a constexpr to fix -Wformat-nonliteral
+          warning.
+
 2021-10-27  Kimmo Kinnunen  <kkinnu...@apple.com>
 
         REGRESSION (Safari 15): Poor WebGL performance on https://downloads.scirra.com/labs/particles

Modified: trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig (285101 => 285102)


--- trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig	2021-11-01 08:42:19 UTC (rev 285101)
+++ trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig	2021-11-01 13:17:55 UTC (rev 285102)
@@ -61,7 +61,7 @@
 
 PREBINDING = NO;
 
-WARNING_CFLAGS = -Wglobal-constructors -Wno-inconsistent-missing-override;
+WARNING_CFLAGS = -Wformat=2 -Wglobal-constructors -Wno-inconsistent-missing-override;
 
 SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx appletvos appletvsimulator watchos watchsimulator;
 SUPPORTS_MACCATALYST = YES;

Modified: trunk/Source/ThirdParty/ANGLE/src/common/angleutils.h (285101 => 285102)


--- trunk/Source/ThirdParty/ANGLE/src/common/angleutils.h	2021-11-01 08:42:19 UTC (rev 285101)
+++ trunk/Source/ThirdParty/ANGLE/src/common/angleutils.h	2021-11-01 13:17:55 UTC (rev 285102)
@@ -186,8 +186,6 @@
     return strstr.str();
 }
 
-size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char> &buffer);
-
 template <typename T>
 std::string ToString(const T &value)
 {
@@ -372,4 +370,6 @@
 #    define ANGLE_REQUIRE_CONSTANT_INIT
 #endif  // __has_cpp_attribute(require_constant_initialization)
 
+size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char> &buffer) ANGLE_FORMAT_PRINTF(1, 0);
+
 #endif  // COMMON_ANGLEUTILS_H_

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/translator/Common.h (285101 => 285102)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/translator/Common.h	2021-11-01 08:42:19 UTC (rev 285101)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/translator/Common.h	2021-11-01 13:17:55 UTC (rev 285102)
@@ -215,7 +215,7 @@
 {
     ASSERT(std::numeric_limits<T>::is_integer);
     char buffer[((8 * sizeof(T)) / 3) + 3];
-    const char *formatStr = std::numeric_limits<T>::is_signed ? "%d" : "%u";
+    constexpr const char *formatStr = std::numeric_limits<T>::is_signed ? "%d" : "%u";
     snprintf(buffer, sizeof(buffer), formatStr, i);
     return buffer;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to