xiaoxiang781216 commented on code in PR #5971:
URL: https://github.com/apache/incubator-nuttx/pull/5971#discussion_r841869054


##########
include/nuttx/compiler.h:
##########
@@ -381,6 +381,12 @@
 
 #  define UNUSED(a) ((void)(1 || (a)))
 
+#  if defined(__clang__)
+#    define no_builtin(n) __attribute__((no_builtin(n)))
+#  else
+#    define no_builtin(n) 
__attribute__((__optimize__("-fno-tree-loop-distribute-patterns")))

Review Comment:
   -ffreestanding can fix the problem because it will automatically enable 
-fno-builtin which we don't want:
   https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
   ```
   -ffreestanding
   Assert that compilation targets a freestanding environment. This implies 
-fno-builtin. A freestanding environment is one in which the standard library 
may not exist, and program startup may not necessarily be at main. The most 
obvious example is an OS kernel. This is equivalent to -fno-hosted.
   
   See [Language Standards Supported by 
GCC](https://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards), for details 
of freestanding and hosted environments.
   ```



-- 
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]

Reply via email to