[Bf-blender-cvs] [9e9355190c0] master: Fix compilation with strict Clang flags

Sergey Sharybin noreply at git.blender.org
Thu Feb 10 10:57:06 CET 2022


Commit: 9e9355190c0c7ae61a752602274637f91c4d8bf3
Author: Sergey Sharybin
Date:   Thu Feb 10 10:55:50 2022 +0100
Branches: master
https://developer.blender.org/rB9e9355190c0c7ae61a752602274637f91c4d8bf3

Fix compilation with strict Clang flags

There is no `-Wformat-truncation` warning in Clang, so tweak checks
around diagnostics pragma accordingly.

===================================================================

M	source/blender/io/wavefront_obj/exporter/obj_export_io.hh

===================================================================

diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
index 7d8427a8980..7e5fe1ca526 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
@@ -129,7 +129,7 @@ constexpr bool is_type_string_related = (... && std::is_constructible_v<std::str
  * results in "obj_export_io.hh:205:18: warning: ā€˜%sā€™ directive output truncated writing 34 bytes
  * into a region of size 6" and similar warnings. Yes the output is truncated, and that is covered
  * as an edge case by tests on purpose. */
-#if defined __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
 #  pragma GCC diagnostic push
 #  pragma GCC diagnostic ignored "-Wformat-truncation"
 #endif



More information about the Bf-blender-cvs mailing list