Menu ▾ ▴

#455 QNX compiler warnings on strerror_r

3.0.1.0
closed
2441 (1)
2024-05-29
2024-05-29
No

Compilation for QNX gives warnings about a suspect cast on strerror_r. This is because QNX strerror_r uses the POSIX definition (returns an integer), not the Linux definition (returns a char pointer).

The following patch fixes the issue:

--- src/vos/posix/vos_private.h (revision 2439)
+++ src/vos/posix/vos_private.h (working copy)
@@ -100,7 +100,7 @@

 /**********************************************************************************************************************/

-#if (((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || __APPLE__)
+#if (((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || __APPLE__ || __QNXNTO__)
 #   define STRING_ERR(pStrBuf)  (void)strerror_r(errno, pStrBuf, VOS_MAX_ERR_STR_SIZE);
 #elif INTEGRITY
 #   define STRING_ERR(pStrBuf)

Discussion

  • Armin-Hagen Weiss

    • labels: --> 2441
    • status: open --> closed
    • assigned_to: Armin-Hagen Weiss
     
  • Armin-Hagen Weiss

    Thanks for the fix Renaat !

     

Log in to post a comment.