casaroli commented on code in PR #21057:
URL: https://github.com/apache/nuttx/pull/21057#discussion_r4400501663


##########
include/nuttx/compiler.h:
##########
@@ -1538,14 +1655,123 @@
  * keep some non-standard names free for its own use.  Then the headers do
  * not define ERROR and OK (sys/types.h), set_errno() and get_errno()
  * (errno.h), zalloc() (stdlib.h), O_TEXT (fcntl.h) and the helper macros
- * below.  The other headers do not use these names.
+ * of this file below, such as memory_barrier() and UNUSED().  The headers
+ * that a program includes do not use these names.  A definition that the
+ * program made before is restored (saved at the start of this file).
  */
 
 #ifdef NUTTX_NO_EXTENSIONS
 #  undef weak_alias
 #  undef visibility_hidden
 #  undef visibility_default
 #  undef unused_data
+#  undef PRAGMA
+#  undef unroll_loop

Review Comment:
   All compilers get the same `#undef` list. Only the restore needs `#pragma 
push_macro`: nettle's `config.h` defines `UNUSED` before its first `#include`, 
and with the `#undef` alone nettle does not build. A compiler without the 
pragma gives the result of master for its four hidden macros.
   



##########
include/nuttx/compiler.h:
##########
@@ -261,7 +261,8 @@
                                  extern __inline__ no_builtin(#fn) \
                                  __attribute__((__always_inline__, \
                                                 __gnu_inline__, 
__artificial__))
-#  elif defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && defined(__has_builtin)
+#  elif defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && \
+         defined(__has_builtin) && !defined(NUTTX_NO_EXTENSIONS)

Review Comment:
   `string.h` uses `builtin_function()` after this file ends (string.h:238 for 
`memcpy()` to string.h:447 for `strrchr()`), so this file cannot remove it at 
its end. With `NUTTX_NO_EXTENSIONS` it is not defined, and `string.h` declares 
the plain functions.
   



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