xiaoxiang781216 commented on code in PR #8867:
URL: https://github.com/apache/nuttx/pull/8867#discussion_r1144962798


##########
libs/libc/string/lib_strsignal.c:
##########
@@ -22,53 +22,24 @@
  * Included Files
  ****************************************************************************/
 
+#include <errno.h>
 #include <signal.h>
+#include <stdio.h>
 #include <string.h>
 
 /****************************************************************************
- * Private Data
+ * Pre-processor Definitions
  ****************************************************************************/
 
-/* We don't know what signals names will be assigned to which signals in
- * advance and we do not want to return a volatile value.  One solution is
- * this silly array of useless names:
- */
-
-static FAR const char *g_default_sigstr[32] =
-{
-  "Signal 0",
-  "Signal 1",
-  "Signal 2",
-  "Signal 3",
-  "Signal 4",
-  "Signal 5",
-  "Signal 6",
-  "Signal 7",
-  "Signal 8",
-  "Signal 9",
-  "Signal 10",
-  "Signal 11",
-  "Signal 12",
-  "Signal 13",
-  "Signal 14",
-  "Signal 15",
-  "Signal 16",
-  "Signal 17",
-  "Signal 18",
-  "Signal 19",
-  "Signal 20",
-  "Signal 21",
-  "Signal 22",
-  "Signal 23",
-  "Signal 24",
-  "Signal 25",
-  "Signal 26",
-  "Signal 27",
-  "Signal 28",
-  "Signal 29",
-  "Signal 30",
-  "Signal 31",
-};
+#ifdef CONFIG_LIBC_STRSIGNAL_SHORT
+#  define CASE_SIG_STR(sig, msg) \

Review Comment:
   like strerror:
   
   1. LIBC_STRSIGNAL=n, return "Unknown signal"
   2. LIBC_STRSIGNAL=y, CONFIG_LIBC_STRERROR_SHORT=y, return "Signal xx"
   3. LIBC_STRSIGNAL=y, CONFIG_LIBC_STRERROR_SHORT=n, return "SIGWORK"...
   



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to