<div dir="auto">I have a patch in my tree that fixes that warning by making us actually return the error code in that function rather than simply using it as a fancy print function. I think that's the better fix.</div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 11, 2016 9:06 AM, "Grazvydas Ignotas" <<a href="mailto:notasas@gmail.com">notasas@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Emitted on release build in case vk_error() return is not used.<br>
<br>
Signed-off-by: Grazvydas Ignotas <<a href="mailto:notasas@gmail.com">notasas@gmail.com</a>><br>
---<br>
no commit access<br>
<br>
src/vulkan/vk_util.c | 4 ++++<br>
src/vulkan/vk_util.h | 13 ++++++++-----<br>
2 files changed, 12 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/vulkan/vk_util.c b/src/vulkan/vk_util.c<br>
index 5d38117..716b8e5 100644<br>
--- a/src/vulkan/vk_util.c<br>
+++ b/src/vulkan/vk_util.c<br>
@@ -60,6 +60,8 @@ __vk_finishme(const char *file, int line, const char *format, ...)<br>
fprintf(stderr, "%s:%d: FINISHME: %s\n", file, line, buffer);<br>
}<br>
<br>
+#ifdef DEBUG<br>
+<br>
VkResult<br>
__vk_errorf(VkResult error, const char *file, int line, const char *format, ...)<br>
{<br>
@@ -103,3 +105,5 @@ __vk_errorf(VkResult error, const char *file, int line, const char *format, ...)<br>
<br>
return error;<br>
}<br>
+<br>
+#endif /* DEBUG */<br>
diff --git a/src/vulkan/vk_util.h b/src/vulkan/vk_util.h<br>
index c384838..5ce206c 100644<br>
--- a/src/vulkan/vk_util.h<br>
+++ b/src/vulkan/vk_util.h<br>
@@ -72,15 +72,18 @@ align_i32(int32_t v, int32_t a)<br>
* propagating errors. Might be useful to plug in a stack trace here.<br>
*/<br>
<br>
+#ifdef DEBUG<br>
VkResult __vk_errorf(VkResult error, const char *file, int line, const char *format, ...);<br>
+#else<br>
+static inline VkResult<br>
+__vk_errorf(VkResult error, const char *file, int line, const char *format, ...)<br>
+{<br>
+ return error;<br>
+}<br>
+#endif<br>
<br>
-#ifdef DEBUG<br>
#define vk_error(error) __vk_errorf(error, __FILE__, __LINE__, NULL);<br>
#define vk_errorf(error, format, ...) __vk_errorf(error, __FILE__, __LINE__, format, ## __VA_ARGS__);<br>
-#else<br>
-#define vk_error(error) error<br>
-#define vk_errorf(error, format, ...) error<br>
-#endif<br>
<br>
void __vk_finishme(const char *file, int line, const char *format, ...)<br>
vk_printflike(3, 4);<br>
--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>