From 1a8216b7cd6f272253e7381bc520c65b7dd38b24 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 26 Oct 2023 03:22:01 +0800 Subject: Fix warnings for gcc 12.3 (#3286) * Silence a few gcc out of bounds warnings * Search upwards from executable for prelude directory instead of assuming depth * comment wording * Check return values of read and write * Correct path to vulkan headers in gfx * Correct diagnostic on missing file in slang-embed * Do not use absolute path to libraries in test-context.cpp --------- Co-authored-by: Yong He --- source/core/slang-io.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/core/slang-io.cpp') diff --git a/source/core/slang-io.cpp b/source/core/slang-io.cpp index 8a2243b15..4ef5ecc2d 100644 --- a/source/core/slang-io.cpp +++ b/source/core/slang-io.cpp @@ -126,7 +126,8 @@ namespace Slang List buffer; auto copySize = builder.getLength(); buffer.setCount(copySize + 1); - SLANG_ASSERT(copySize < PTRDIFF_MAX); // Shhh gcc, it's ok, we're not copying 9000 Petabytes + // Satisfy GCC + SLANG_ASSUME(copySize < PTRDIFF_MAX && copySize > 0); ::memcpy(buffer.getBuffer(), builder.getBuffer(), copySize); buffer[copySize] = 0; -- cgit v1.2.3