build error no1: ----------------- ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp: In function 'WTF::String WebCore::nextToken(FILE*)': ../../Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:69:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] if (ch == EOF || (isASCIISpace(ch) && index)) // Break on non-initial ASCII space. ^ cc1plus: all warnings being treated as errors build error no2: ----------------- ../../Source/WebKit2/Shared/linux/WebMemorySamplerLinux.cpp: In function 'WTF::String WebKit::nextToken(FILE*)': ../../Source/WebKit2/Shared/linux/WebMemorySamplerLinux.cpp:70:16: error: comparison is always false due to limited range of data type [-Werror=type-limits] if (ch == EOF || (isASCIISpace(ch) && index)) // Break on non-initial ASCII space. ^ cc1plus: all warnings being treated as errors ---- char ch = fgetc(file); ----> fgetc returns an int which is casted to char (signed char on X86_64 and unsigned char on ARM). EOF is defined as -1. (int) If fgetc returns with EOF, it will be 255 after casting unsigned char. When comparing the unsigned char 255 and the int -1, the unsigned char 255 will be casted to int 255 which will never be equal to -1. $ man fgetc [snip] fgetc() reads the next character from stream and returns it as an unsigned char cast to an int, or EOF on end of file or error. [snip] The correct fix is to avoid casting the return value of fgetc.
Just to document, http://trac.webkit.org/changeset/127195 added the Source/WebKit2/Shared/linux/WebMemorySamplerLinux.cpp change and http://trac.webkit.org/changeset/177216 added (copied) this bug into Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp.
Created attachment 252048 [details] Patch
Comment on attachment 252048 [details] Patch r=me
Comment on attachment 252048 [details] Patch Clearing flags on attachment: 252048 Committed r183740: <http://trac.webkit.org/changeset/183740>
All reviewed patches have been landed. Closing bug.
*** Bug 104613 has been marked as a duplicate of this bug. ***