diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-08-15 08:19:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-08-15 13:38:14 +0200 |
commit | 5b5f6b147f5f2a02476a14ed2d8feb247d5a7c79 (patch) | |
tree | ad9ff2aec1675289153747cf00e53775cfaeecd0 /external/nss | |
parent | dbd104083dc4cc22075556811e67b5c81ef688ae (diff) |
external/nss: Fix -Wincompatible-function-pointer-types
...with recent Clang 16 trunk since
<https://github.com/llvm/llvm-project/commit/af01f717c48f0fd2481600ed6c00441763365b62>
"Default implicit function pointer conversions diagnostic to be an error",
causing
> ../../../pr/tests/testfile.c:126:41: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-function-pointer-types]
> if (!pthread_create(&tid, NULL, start, arg)) {
> ^~~~~
> /usr/include/pthread.h:204:15: note: passing argument to parameter '__start_routine' here
> void *(*__start_routine) (void *),
> ^
and
> ../../../pr/tests/testfile.c:576:31: error: incompatible function pointer types passing 'PRInt32 (void *)' (aka 'int (void *)') to parameter of type 'void (*)(void *)' [-Wincompatible-function-pointer-types]
> DirTest, &thrarg,
> ^~~~~~~
> ../../../pr/tests/testfile.c:93:36: note: passing argument to parameter 'start' here
> void (*start)(void *arg),
> ^
Change-Id: I642e5ca69289993c86abafded65ac23a63fd837e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138267
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external/nss')
-rw-r--r-- | external/nss/UnpackedTarball_nss.mk | 1 | ||||
-rw-r--r-- | external/nss/Wincompatible-function-pointer-types.patch.0 | 234 |
2 files changed, 235 insertions, 0 deletions
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk index 32ba88f2bd5a..b7373772152a 100644 --- a/external/nss/UnpackedTarball_nss.mk +++ b/external/nss/UnpackedTarball_nss.mk @@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\ external/nss/nss-bz1646594.patch.1 \ external/nss/macos-dlopen.patch.0 \ external/nss/nss-restore-manual-pre-dependencies.patch.1 \ + external/nss/Wincompatible-function-pointer-types.patch.0 \ $(if $(filter iOS,$(OS)), \ external/nss/nss-ios.patch) \ $(if $(filter ANDROID,$(OS)), \ diff --git a/external/nss/Wincompatible-function-pointer-types.patch.0 b/external/nss/Wincompatible-function-pointer-types.patch.0 new file mode 100644 index 000000000000..1e9b7550e1da --- /dev/null +++ b/external/nss/Wincompatible-function-pointer-types.patch.0 @@ -0,0 +1,234 @@ +--- nspr/pr/tests/testfile.c ++++ nspr/pr/tests/testfile.c +@@ -86,7 +86,7 @@ + #endif + #define TMPDIR_LEN 64 + char testdir[TMPDIR_LEN]; +-static PRInt32 PR_CALLBACK DirTest(void *argunused); ++static void PR_CALLBACK DirTest(void *argunused); + PRInt32 dirtest_failed = 0; + + PRThread* create_new_thread(PRThreadType type, +@@ -123,7 +123,7 @@ + if (native_thread) { + #if defined(_PR_PTHREADS) + pthread_t tid; +- if (!pthread_create(&tid, NULL, start, arg)) { ++ if (!pthread_create(&tid, NULL, (void *(*)(void *))start, arg)) { + return((PRThread *) tid); + } + else { +@@ -594,7 +594,7 @@ + return 0; + } + +-static PRInt32 PR_CALLBACK DirTest(void *arg) ++static void PR_CALLBACK DirTest(void *arg) + { + struct dirtest_arg *tinfo = (struct dirtest_arg *) arg; + PRFileDesc *fd_file; +@@ -618,14 +618,14 @@ + printf( + "testfile failed to create dir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + fd_dir = PR_OpenDir(TEST_DIR); + if (fd_dir == NULL) { + printf( + "testfile failed to open dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + strcpy(pathname, TEST_DIR); +@@ -645,7 +645,7 @@ + printf( + "testfile failed to create/open file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + PR_Close(fd_file); + } +@@ -664,7 +664,7 @@ + printf( + "testfile failed to create/open hidden file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + PR_Close(fd_file); +@@ -681,7 +681,7 @@ + if (hfile == INVALID_HANDLE_VALUE) { + printf("testfile failed to create/open hidden file %s [0, %d]\n", + pathname, GetLastError()); +- return -1; ++ return; + } + CloseHandle(hfile); + +@@ -696,7 +696,7 @@ + if (hfile == INVALID_HANDLE_VALUE) { + printf("testfile failed to create/open hidden file %s [0, %d]\n", + pathname, GetLastError()); +- return -1; ++ return; + } + CloseHandle(hfile); + +@@ -707,7 +707,7 @@ + if (fd_file == NULL) { + printf("testfile failed to create/open hidden file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + PR_Close(fd_file); + #endif /* XP_UNIX */ +@@ -720,14 +720,14 @@ + printf( + "testfile failed to close dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + fd_dir = PR_OpenDir(TEST_DIR); + if (fd_dir == NULL) { + printf( + "testfile failed to reopen dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + /* +@@ -750,14 +750,14 @@ + printf( + "testfile failed to GetFileInfo file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + if (info.type != PR_FILE_FILE) { + printf( + "testfile incorrect fileinfo for file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + } + if (num_files != 0) +@@ -765,7 +765,7 @@ + printf( + "testfile failed to find all files in directory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + PR_CloseDir(fd_dir); +@@ -781,7 +781,7 @@ + printf( + "testfile failed to reopen dirctory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + DPRINTF(("Listing non-hidden files in directory %s\n",TEST_DIR)); +@@ -789,7 +789,7 @@ + DPRINTF(("\t%s\n",dirEntry->name)); + if (!strcmp(HIDDEN_FILE_NAME, dirEntry->name)) { + printf("testfile found hidden file %s\n", pathname); +- return -1; ++ return; + } + + } +@@ -803,7 +803,7 @@ + printf( + "testfile failed to delete hidden file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + PR_CloseDir(fd_dir); +@@ -815,41 +815,41 @@ + printf( + "testfile failed to rename directory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + if (PR_FAILURE == PR_MkDir(TEST_DIR, 0777)) { + printf( + "testfile failed to recreate dir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + if (PR_SUCCESS == PR_Rename(renamename, TEST_DIR)) { + printf( + "testfile renamed directory to existing name %s\n", + renamename); +- return -1; ++ return; + } + + if (PR_FAILURE == PR_RmDir(TEST_DIR)) { + printf( + "testfile failed to rmdir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + if (PR_FAILURE == PR_Rename(renamename, TEST_DIR)) { + printf( + "testfile failed to rename directory %s [%d, %d]\n", + renamename, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + fd_dir = PR_OpenDir(TEST_DIR); + if (fd_dir == NULL) { + printf( + "testfile failed to reopen directory %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + + strcpy(pathname, TEST_DIR); +@@ -865,7 +865,7 @@ + printf( + "testfile failed to delete file %s [%d, %d]\n", + pathname, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + } + +@@ -875,14 +875,13 @@ + printf( + "testfile failed to rmdir %s [%d, %d]\n", + TEST_DIR, PR_GetError(), PR_GetOSError()); +- return -1; ++ return; + } + PR_EnterMonitor(tinfo->mon); + tinfo->done = 1; + PR_Notify(tinfo->mon); + PR_ExitMonitor(tinfo->mon); + +- return 0; + } + /************************************************************************/ + |