forked from pool/spirv-tools
Jan Engelhardt
31d3c23a26
OBS-URL: https://build.opensuse.org/package/show/X11:Wayland/spirv-tools?expand=0&rev=68
31 lines
999 B
Diff
31 lines
999 B
Diff
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(-)
|
|
|
|
Index: SPIRV-Tools-2021.1/tools/io.h
|
|
===================================================================
|
|
--- SPIRV-Tools-2021.1.orig/tools/io.h
|
|
+++ SPIRV-Tools-2021.1/tools/io.h
|
|
@@ -60,7 +60,8 @@ bool WasFileCorrectlyRead(FILE* file, co
|
|
return false;
|
|
}
|
|
} else {
|
|
- if (sizeof(T) != 1 && (ftell(file) % sizeof(T))) {
|
|
+ long ftx = ftell(file);
|
|
+ if (sizeof(T) != 1 && ftx % sizeof(T) != 0) {
|
|
fprintf(
|
|
stderr,
|
|
"error: file size should be a multiple of %zd; file '%s' corrupt\n",
|