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.
Created attachment 244498 [details] Patch Fixed 32 bit debug build error by using proper format specifier.
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.
Comment on attachment 244498 [details] Patch LGTM, r=me
Comment on attachment 244498 [details] Patch no, it won't be good, because it would break 64 bit build.
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.
Created attachment 244502 [details] Patch-Updated-Review1 Updated the patch to use %lu and apply static_cast<unsigned long> for printing logs.
Comment on attachment 244502 [details] Patch-Updated-Review1 Clearing flags on attachment: 244502 Committed r178349: <http://trac.webkit.org/changeset/178349>
All reviewed patches have been landed. Closing bug.
Thanks for the fix. =) I didn't think 32-bit machine support.