2017-02-02 20:03:27 +01:00
|
|
|
From: Jan Engelhardt <jengelh@inai.de>
|
|
|
|
Date: 2017-02-02 19:42:44.679588946 +0100
|
|
|
|
|
|
|
|
build: workaround gcc 4.8 bug
|
|
|
|
|
|
|
|
tools/io.h:41:38:
|
|
|
|
error: ignoring return value of 'long int ftell(FILE*)',
|
|
|
|
declared with attribute warn_unused_result [-Werror=unused-result,-Werror]
|
|
|
|
if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) {
|
|
|
|
|
|
|
|
Workaround gcc 4.8's wrongful idea that ftell's return value
|
|
|
|
were ignored.
|
|
|
|
---
|
|
|
|
tools/io.h | 3 ++-
|
|
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
|
2018-08-25 08:28:24 +02:00
|
|
|
Index: spirv-tools-2018.4.g0/tools/io.h
|
2017-02-02 20:03:27 +01:00
|
|
|
===================================================================
|
2018-08-25 08:28:24 +02:00
|
|
|
--- spirv-tools-2018.4.g0.orig/tools/io.h
|
|
|
|
+++ spirv-tools-2018.4.g0/tools/io.h
|
2017-02-02 20:03:27 +01:00
|
|
|
@@ -38,7 +38,8 @@ bool ReadFile(const char* filename, cons
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
- if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) {
|
|
|
|
+ long ftx = ftell(fp);
|
|
|
|
+ if (sizeof(T) != 1 && ftx % sizeof(T) != 0) {
|
2018-08-25 08:28:24 +02:00
|
|
|
fprintf(
|
|
|
|
stderr,
|
|
|
|
"error: file size should be a multiple of %zd; file '%s' corrupt\n",
|