Posix port compile issues

I am still getting error, I have downloaded the latest file. I didn’t find *&xSchedulerOriginalSignalMask, but still showing that error.
Please try to provide some solution @rowbearto

error: incompatible type for argument 3 of ‘pthread_sigmask’
*&xSchedulerOriginalSignalMask );
^
In file included from /usr/include/signal.h:359:0,
from /home/jmayank/Desktop/FreeRTOSv202012.00-LTS/FreeRTOSv202012.00/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:53:
/usr/include/x86_64-linux-gnu/bits/sigthread.h:31:12: note: expected ‘__sigset_t * restrict {aka struct * restrict}’ but argument is of type ‘sigset_t {aka struct }’
extern int pthread_sigmask (int __how,

Hey @jmayank, you’re completely right that the 2020-12 version has this bug. Thank you for bringing this to our attention. We’re discussion solutions now but hope to have a patch, or something similar out soon.

As a workaround, you can simply remove the * to make the parameter &xSchedulerOriginalSignalMask like what was done here. This should get your build working.

Edit: previous write up was incorrect so I removed it.

One interesting note - when building on a Mac with clang, the problem does arise as a warning, not an error.

/Users/kstribrn/workspace/kstribrnFreeRTOS/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:528:28: warning: incompatible integer to pointer conversion passing 'sigset_t' (aka 'unsigned int') to parameter of type 'sigset_t * _Nullable' (aka 'unsigned int *'); remove * [-Wint-conversion]
                           *&xSchedulerOriginalSignalMask );
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:83:54: note: passing argument to parameter here
int     pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);

Exact clang version info:

Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.4.0
Thread model: posix

@jmayank Got done talking with my team (after learning a bit regarding our LTS versions). We won’t be patching this in the 2020-12 LTS release for a couple reasons:

  • The workaround is simple to implement (remove the erroneous ‘*’ or use a newer LTS version) but the patch would have far reaching impact for other LTS users of this version.
  • The POSIX port is a third party port and doesn’t see production use since it’s for demonstration/experimentation.

I hope this justification gives some transparency into our thought process. Best of luck on your development and feel free to reach out if you face further issues. :slight_smile: