tinnedkarma commented on code in PR #17316: URL: https://github.com/apache/nuttx/pull/17316#discussion_r2528588967
########## include/nuttx/compiler.h: ########## @@ -213,6 +220,25 @@ # define predict_true(x) __builtin_expect(!!(x), 1) # define predict_false(x) __builtin_expect(!!(x), 0) +/* `x` can be evaluated at compile time */ + +# define is_constexpr(x) __builtin_constant_p(x) + +/* Assume the condition is satisfied. + * We can use this to perform more aggressive compiler optimizations. + * Please use this with caution, as it may cause runtime errors if you fail + * to ensure that the condition is satisfied. + */ + +# if defined(__clang__) Review Comment: There are Kconfig options defined in arch/Kconfig, and in each arch sub-folder. Here we are using the flags set by the compiler itself. Why not use those, or what is the use of those. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
