Skip to content

Fix for pthreads on MSYS2 & MINGW#6881

Merged
JacobBarthelmeh merged 4 commits intowolfSSL:masterfrom
lealem47:mingw_pthreads
Oct 17, 2023
Merged

Fix for pthreads on MSYS2 & MINGW#6881
JacobBarthelmeh merged 4 commits intowolfSSL:masterfrom
lealem47:mingw_pthreads

Conversation

@lealem47
Copy link
Copy Markdown
Contributor

Description

Fix for pthread issues in #6874 and #6838.

Includes a fix for a truncated output warning. This was resolved by incrementing MAX_PATH and MAX_FILENAME_SZ to 260+1 as the max value on windows is 260 (https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry)

In file included from wolfcrypt/src/wc_port.c:28:
wolfcrypt/src/wc_port.c: In function 'wc_ReadDirFirst':
./wolfssl/wolfcrypt/types.h:674:35: error: 'strncpy' output may be truncated copying between 0 and 255 bytes from a string of length 259 [-Werror=stringop-truncation]
  674 |         #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
wolfcrypt/src/wc_port.c:635:13: note: in expansion of macro 'XSTRNCPY'
  635 |             XSTRNCPY(ctx->name + pathLen + 1,
      |             ^~~~~~~~
wolfcrypt/src/wc_port.c: In function 'wc_ReadDirNext':
./wolfssl/wolfcrypt/types.h:674:35: error: 'strncpy' output may be truncated copying between 0 and 255 bytes from a string of length 259 [-Werror=stringop-truncation]
  674 |         #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
wolfcrypt/src/wc_port.c:788:13: note: in expansion of macro 'XSTRNCPY'
  788 |             XSTRNCPY(ctx->name + pathLen + 1,
      |             ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:6351: wolfcrypt/src/src_libwolfssl_la-wc_port.lo] Error 1

Testing

Reproduced reports on mingw. These changes resolved the problems locally.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@lealem47 lealem47 self-assigned this Oct 17, 2023
dgarske
dgarske previously approved these changes Oct 17, 2023
Copy link
Copy Markdown
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passes now with ./autogen.sh && ./configure --host=x86_64-w64-mingw32 && make. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants