Title: [263062] trunk/Source/WTF
- Revision
- 263062
- Author
- [email protected]
- Date
- 2020-06-15 14:57:31 -0700 (Mon, 15 Jun 2020)
Log Message
Consistently use WTF_ATTRIBUTE_PRINTF in Assertions.[cpp,h]
https://bugs.webkit.org/show_bug.cgi?id=213204
Patch by Michael Catanzaro <[email protected]> on 2020-06-15
Reviewed by Darin Adler.
Use WTF_ATTRIBUTE_PRINTF for all functions taking a printf format specifier. The first
argument should be the position of the format string itself (starting from 1), and the
second argument should be the position of the ... parameter pack, or 0 for functions that
take a va_list.
* wtf/Assertions.cpp:
* wtf/Assertions.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (263061 => 263062)
--- trunk/Source/WTF/ChangeLog 2020-06-15 21:36:13 UTC (rev 263061)
+++ trunk/Source/WTF/ChangeLog 2020-06-15 21:57:31 UTC (rev 263062)
@@ -1,3 +1,18 @@
+2020-06-15 Michael Catanzaro <[email protected]>
+
+ Consistently use WTF_ATTRIBUTE_PRINTF in Assertions.[cpp,h]
+ https://bugs.webkit.org/show_bug.cgi?id=213204
+
+ Reviewed by Darin Adler.
+
+ Use WTF_ATTRIBUTE_PRINTF for all functions taking a printf format specifier. The first
+ argument should be the position of the format string itself (starting from 1), and the
+ second argument should be the position of the ... parameter pack, or 0 for functions that
+ take a va_list.
+
+ * wtf/Assertions.cpp:
+ * wtf/Assertions.h:
+
2020-06-15 Keith Miller <[email protected]>
Unreviewed, build fix for build without mach exceptions.
Modified: trunk/Source/WTF/wtf/Assertions.cpp (263061 => 263062)
--- trunk/Source/WTF/wtf/Assertions.cpp 2020-06-15 21:36:13 UTC (rev 263061)
+++ trunk/Source/WTF/wtf/Assertions.cpp 2020-06-15 21:57:31 UTC (rev 263062)
@@ -174,6 +174,7 @@
ALLOW_NONLITERAL_FORMAT_BEGIN
+WTF_ATTRIBUTE_PRINTF(2, 0)
static void vprintf_stderr_with_prefix(const char* prefix, const char* format, va_list args)
{
size_t prefixLength = strlen(prefix);
@@ -186,6 +187,7 @@
vprintf_stderr_common(formatWithPrefix.data(), args);
}
+WTF_ATTRIBUTE_PRINTF(1, 0)
static void vprintf_stderr_with_trailing_newline(const char* format, va_list args)
{
size_t formatLength = strlen(format);
@@ -419,6 +421,7 @@
va_end(args);
}
+WTF_ATTRIBUTE_PRINTF(2, 0)
static void WTFLogVaList(WTFLogChannel* channel, const char* format, va_list args)
{
if (channel->state == WTFLogChannelState::Off)
Modified: trunk/Source/WTF/wtf/Assertions.h (263061 => 263062)
--- trunk/Source/WTF/wtf/Assertions.h 2020-06-15 21:36:13 UTC (rev 263061)
+++ trunk/Source/WTF/wtf/Assertions.h 2020-06-15 21:57:31 UTC (rev 263062)
@@ -208,7 +208,7 @@
WTF_EXPORT_PRIVATE void WTFReportError(const char* file, int line, const char* function, const char* format, ...) WTF_ATTRIBUTE_PRINTF(4, 5);
WTF_EXPORT_PRIVATE void WTFLog(WTFLogChannel*, const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3);
WTF_EXPORT_PRIVATE void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChannel*, const char* format, ...) WTF_ATTRIBUTE_PRINTF(5, 6);
-WTF_EXPORT_PRIVATE void WTFLogAlwaysV(const char* format, va_list);
+WTF_EXPORT_PRIVATE void WTFLogAlwaysV(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(1, 0);
WTF_EXPORT_PRIVATE void WTFLogAlways(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFLogAlwaysAndCrash(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
WTF_EXPORT_PRIVATE WTFLogChannel* WTFLogChannelByName(WTFLogChannel*[], size_t count, const char*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes