bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error: Support the compiler's control flow analysis better (was: cop


From: Paul Eggert
Subject: Re: error: Support the compiler's control flow analysis better (was: copy-file: Silence gcc warnings)
Date: Fri, 2 Jun 2023 15:03:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 6/2/23 11:10, Bruno Haible wrote:
+/* Avoid evaluating STATUS twice, if this is possible without making the
+   "warning: this statement may fall through" reappear.  */
+# if __OPTIMIZE__
+#  define __gl_error_call(function, status, ...) \

That means semantics are different when optimizing; generally speaking optimization should affect only performance, not correctness.

How about changing this to use __builtin_constant_p instead of __OPTIMIZE__? I.e., use the comma expression if __builtin_constant_p (status), and use the statement expression otherwise.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]