Open Bug 1868862 Opened 6 months ago Updated 5 months ago

Failure to build pr/tests/testfile.c under clang-17 on searchfox indexer run using `make nss_build_all` breaks searchfox semantic indexing.

Categories

(NSS :: Build, defect, P2)

Tracking

(Not tracked)

People

(Reporter: asuth, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Searchfox currently builds nss locally on its indexer EC2 jobs; we recently upgraded to clang-17 for consistency with mozilla-central and pr/tests/testfile.c is now failing to compile; we see the error below. This breaks semantic indexing for nss.

../../../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]
  576 |                               DirTest, &thrarg,
      |                               ^~~~~~~

The full compilation for that file including other warnings:

clang -Xclang -load -Xclang /home/ubuntu/mozsearch/clang-plugin/libclang-index-plugin.so -Xclang -add-plugin -Xclang mozsearch-index -Xclang -plugin-arg-mozsearch-index -Xclang /mnt/index-scratch/nss/git -Xclang -plugin-arg-mozsearch-index -Xclang /mnt/index-scratch/nss/analysis -Xclang -plugin-arg-mozsearch-index -Xclang /mnt/index-scratch/nss/dist -Xclang -fparse-all-comments -o testfile.o -c -fvisibility=hidden     -Wall -pthread -g -fno-inline -fPIC  -UNDEBUG -DDEBUG_ubuntu -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DDEBUG=1 -DHAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1 -DHAVE_VISIBILITY_PRAGMA=1 -DXP_UNIX=1 -D_GNU_SOURCE=1 -DHAVE_FCNTL_FILE_LOCKING=1 -DHAVE_POINTER_LOCALTIME_R=1 -DLINUX=1 -DHAVE_DLADDR=1 -DHAVE_GETTID=1 -DHAVE_LCHOWN=1 -DHAVE_SETPRIORITY=1 -DHAVE_STRERROR=1 -DHAVE_SYSCALL=1 -DHAVE_SECURE_GETENV=1 -D_REENTRANT=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -I/mnt/index-scratch/nss/git/../dist/Linux6.2_x86_64_clang_glibc_PTH_64_DBG.OBJ/include -I../../../pr/include -I../../../pr/include/private  ../../../pr/tests/testfile.c
../../../pr/tests/testfile.c:126:41: error: incompatible function pointer types passing 'void (*)(void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-function-pointer-types]
  126 |         if (!pthread_create(&tid, NULL, start, arg)) {
      |                                         ^~~~~
/usr/include/pthread.h:204:15: note: passing argument to parameter '__start_routine' here
  204 |                            void *(*__start_routine) (void *),
      |                                    ^
../../../pr/tests/testfile.c:319:42: warning: format specifies type 'long long' but the argument has type 'PRTime' (aka 'long') [-Wformat]
  319 |         printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
      |                      ~~~~                ^~~~~~~~~~~~~~~~~~~~~~
      |                      %ld
../../../pr/tests/testfile.c:320:16: warning: format specifies type 'long long' but the argument has type 'PRTime' (aka 'long') [-Wformat]
  319 |         printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
      |                                  ~~~~
      |                                  %ld
  320 |                file_info1.creationTime);
      |                ^~~~~~~~~~~~~~~~~~~~~~~
../../../pr/tests/testfile.c:345:42: warning: format specifies type 'long long' but the argument has type 'PRTime' (aka 'long') [-Wformat]
  345 |         printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
      |                      ~~~~                ^~~~~~~~~~~~~~~~~~~~
      |                      %ld
../../../pr/tests/testfile.c:346:16: warning: format specifies type 'long long' but the argument has type 'PRTime' (aka 'long') [-Wformat]
  345 |         printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
      |                                  ~~~~
      |                                  %ld
  346 |                file_info1.modifyTime);
      |                ^~~~~~~~~~~~~~~~~~~~~
../../../pr/tests/testfile.c:412:15: warning: variable 't' set but not used [-Wunused-but-set-variable]
  412 |     PRThread *t;
      |               ^
../../../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]
  576 |                               DirTest, &thrarg,
      |                               ^~~~~~~
../../../pr/tests/testfile.c:93:36: note: passing argument to parameter 'start' here
   93 |                             void (*start)(void *arg),
      |                                    ^
5 warnings and 2 errors generated.
MOZSEARCH: /mnt/index-scratch/nss/git /mnt/index-scratch/nss/analysis/ /mnt/index-scratch/nss/dist/
make[2]: *** [../../../config/rules.mk:450: testfile.o] Error 1
make[2]: Leaving directory '/mnt/index-scratch/nss/nspr/Linux6.2_x86_64_clang_glibc_PTH_64_DBG.OBJ/pr/tests'
Severity: -- → S4
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: