RESOLVED FIXED 140383
Fix Debug Build Error in Webcore module
https://bugs.webkit.org/show_bug.cgi?id=140383
Summary Fix Debug Build Error in Webcore module
Shivakumar J M
Reported 2015-01-12 23:00:24 PST
Got below debug build error for 32-bit efl port: CMakeFiles/WebCore.dir/platform/linux/MemoryPressureHandlerLinux.cpp.o -c ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp In file included from ../../Source/WTF/wtf/PossiblyNull.h:29:0, from ../../Source/WTF/wtf/FastMalloc.h:26, from ../../Source/WebCore/config.h:75, from ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:27: ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp: In member function ‘void WebCore::MemoryPressureHandler::ReliefLogger::platformLog()’: ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t {aka int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:212:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: -dirty %ld bytes (from %ld to %ld)", m_logString, (memoryDiff * -1), m_initialMemory, currentMemory); ^ ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘size_t {aka unsigned int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:212:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: -dirty %ld bytes (from %ld to %ld)", m_logString, (memoryDiff * -1), m_initialMemory, currentMemory); ^ ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘size_t {aka unsigned int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:212:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: -dirty %ld bytes (from %ld to %ld)", m_logString, (memoryDiff * -1), m_initialMemory, currentMemory); ^ ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t {aka int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:214:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: +dirty %ld bytes (from %ld to %ld)", m_logString, memoryDiff, m_initialMemory, currentMemory); ^ ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘size_t {aka unsigned int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:214:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: +dirty %ld bytes (from %ld to %ld)", m_logString, memoryDiff, m_initialMemory, currentMemory); ^ ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘size_t {aka unsigned int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:214:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: +dirty %ld bytes (from %ld to %ld)", m_logString, memoryDiff, m_initialMemory, currentMemory); ^ ../../Source/WTF/wtf/Assertions.h:346:105: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Werror=format=] #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__) ^ ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:216:9: note: in expansion of macro ‘LOG’ LOG(MemoryPressure, "Pressure relief: %s: =dirty (at %ld bytes)", m_logString, currentMemory); ^ cc1plus: all warnings being treated as errors ninja: build stopped: subcommand failed.
Attachments
Patch (2.00 KB, patch)
2015-01-12 23:04 PST, Shivakumar J M
ossy: review-
ossy: commit-queue-
Patch-Updated-Review1 (2.20 KB, patch)
2015-01-13 02:03 PST, Shivakumar J M
no flags
Shivakumar J M
Comment 1 2015-01-12 23:04:27 PST
Created attachment 244498 [details] Patch Fixed 32 bit debug build error by using proper format specifier.
Shivakumar J M
Comment 2 2015-01-13 00:45:41 PST
Fixed 32 bit debug build error by using proper format specifier in LOG(), we can also use type cast to static_cast<long int> to fix the error.
Csaba Osztrogonác
Comment 3 2015-01-13 01:30:02 PST
Comment on attachment 244498 [details] Patch LGTM, r=me
Csaba Osztrogonác
Comment 4 2015-01-13 01:33:19 PST
Comment on attachment 244498 [details] Patch no, it won't be good, because it would break 64 bit build.
Csaba Osztrogonác
Comment 5 2015-01-13 01:36:43 PST
size_t is unsigned int on 32 bit and long unsigned int on 64 bit. So it should be casted to long unsigned int unconditionally.
Shivakumar J M
Comment 6 2015-01-13 02:03:44 PST
Created attachment 244502 [details] Patch-Updated-Review1 Updated the patch to use %lu and apply static_cast<unsigned long> for printing logs.
WebKit Commit Bot
Comment 7 2015-01-13 02:53:42 PST
Comment on attachment 244502 [details] Patch-Updated-Review1 Clearing flags on attachment: 244502 Committed r178349: <http://trac.webkit.org/changeset/178349>
WebKit Commit Bot
Comment 8 2015-01-13 02:53:46 PST
All reviewed patches have been landed. Closing bug.
ChangSeok Oh
Comment 9 2015-01-13 05:19:19 PST
Thanks for the fix. =) I didn't think 32-bit machine support.
Note You need to log in before you can comment on or make changes to this bug.