Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed compile errors and segfaults with gcc 14.x #192

Closed
wants to merge 20 commits into from
Closed

fixed compile errors and segfaults with gcc 14.x #192

wants to merge 20 commits into from

Conversation

lneely
Copy link

@lneely lneely commented Jun 9, 2024

The pcloud console client was not compiling on my system due to multiple compiler errors (e.g., type mismatches without casts). My system is running Arch, and my gcc version is 14.1.1 20240522.

This PR fixes the compilation errors, and cleans up some unused variables & non-existent headers. I also added some things to .gitignore (e.g., compile_commands.json generated by bear, clangd .cache, and CMake-generate files).

@asdf23
Copy link

asdf23 commented Jun 9, 2024

Yes!!

previously getting this issue (in Fedora) : #191

Seems resolved I do get these warnings:

$ make fs
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcompat.o pcompat.c
pcompat.c: In function ‘psync_list_dir’:
pcompat.c:2519:3: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
 2519 |   while (!readdir_r(dh, entry, &de) && de)
      |   ^~~~~
In file included from /usr/include/features.h:491,
                 from /usr/include/pthread.h:21,
                 from pcompat.c:28:
/usr/include/dirent.h:191:12: note: declared here
  191 | extern int __REDIRECT (readdir_r,
      |            ^~~~~~~~~~
pcompat.c: In function ‘psync_list_dir_fast’:
pcompat.c:2613:3: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
 2613 |   while (!readdir_r(dh, entry, &de) && de)
      |   ^~~~~
/usr/include/dirent.h:191:12: note: declared here
  191 | extern int __REDIRECT (readdir_r,
      |            ^~~~~~~~~~
pcompat.c: In function ‘psync_deviceid’:
pcompat.c:3506:5: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
 3506 |     while (!readdir_r(dh, &entry, &de) && de)
      |     ^~~~~
/usr/include/dirent.h:191:12: note: declared here
  191 | extern int __REDIRECT (readdir_r,
      |            ^~~~~~~~~~
In file included from pcompat.c:37:
pssl.h: At top level:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o psynclib.o psynclib.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pcloudcrypto.h:32,
                 from psynclib.c:35:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o plocks.o plocks.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o plibs.o plibs.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcallbacks.o pcallbacks.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pdiff.o pdiff.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pcloudcrypto.h:32,
                 from pdiff.c:33:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pstatus.o pstatus.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o papi.o papi.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ptimer.o ptimer.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pupload.o pupload.c
pupload.c: In function ‘task_renameremotefolder’:
pupload.c:380:24: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  380 |     err_struct.err_msg = psync_find_result(res, "error", PARAM_STR)->str;
      |                        ^
In file included from pupload.c:33:
pssl.h: At top level:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pdownload.o pdownload.c
In file included from pdownload.h:33,
                 from pdownload.c:28:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfolder.o pfolder.c
In file included from pfolder.c:31:
pfolder.c: In function ‘psync_list_remote_folder’:
pfolder.c:716:22: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 6 has type ‘psync_folderid_t’ {aka ‘long unsigned int’} [-Wformat=]
  716 |       debug(D_ERROR, "Can't find folder with id %I64u", folderid);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~
      |                                                         |
      |                                                         psync_folderid_t {aka long unsigned int}
plibs.h:67:108: note: in definition of macro ‘debug’
   67 | if (level<=DEBUG_LEVEL) psync_debug(__FILE__, __FUNCTION__, __LINE__, level, __VA_ARGS__);} while (0)
      |                                                                              ^~~~~~~~~~~

pfolder.c:716:53: note: format string is defined here
  716 |       debug(D_ERROR, "Can't find folder with id %I64u", folderid);
      |                                                 ~~~~^
      |                                                     |
      |                                                     unsigned int
      |                                                 %I64lu
pfolder.c:734:12: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  734 |         tmp=psync_get_lstring(row[2], &namelen);
      |            ^
pfolder.c:737:24: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 6 has type ‘psync_folderid_t’ {aka ‘long unsigned int’} [-Wformat=]
  737 |           debug(D_BUG, "Can't decrypt folder name for folderid: %I64u, parent folfderid: %I64u, cryptoerr: %d, encrypted name: %s. Skippping ...", entry.folder.folderid, folderid, psync_fsfolder_crypto_error(), tmp);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                                                                                |
      |                                                                                                                                                                psync_folderid_t {aka long unsigned int}
plibs.h:67:108: note: in definition of macro ‘debug’
   67 | if (level<=DEBUG_LEVEL) psync_debug(__FILE__, __FUNCTION__, __LINE__, level, __VA_ARGS__);} while (0)
      |                                                                              ^~~~~~~~~~~

pfolder.c:737:69: note: format string is defined here
  737 |           debug(D_BUG, "Can't decrypt folder name for folderid: %I64u, parent folfderid: %I64u, cryptoerr: %d, encrypted name: %s. Skippping ...", entry.folder.folderid, folderid, psync_fsfolder_crypto_error(), tmp);
      |                                                                 ~~~~^
      |                                                                     |
      |                                                                     unsigned int
      |                                                                 %I64lu
pfolder.c:737:24: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 7 has type ‘psync_folderid_t’ {aka ‘long unsigned int’} [-Wformat=]
  737 |           debug(D_BUG, "Can't decrypt folder name for folderid: %I64u, parent folfderid: %I64u, cryptoerr: %d, encrypted name: %s. Skippping ...", entry.folder.folderid, folderid, psync_fsfolder_crypto_error(), tmp);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         ~~~~~~~~
      |                                                                                                                                                                           |
      |                                                                                                                                                                           psync_folderid_t {aka long unsigned int}
plibs.h:67:108: note: in definition of macro ‘debug’
   67 | if (level<=DEBUG_LEVEL) psync_debug(__FILE__, __FUNCTION__, __LINE__, level, __VA_ARGS__);} while (0)
      |                                                                              ^~~~~~~~~~~

pfolder.c:737:94: note: format string is defined here
  737 | D_BUG, "Can't decrypt folder name for folderid: %I64u, parent folfderid: %I64u, cryptoerr: %d, encrypted name: %s. Skippping ...", entry.folder.folderid, folderid, psync_fsfolder_crypto_error(), tmp);
      |                                                                          ~~~~^
      |                                                                              |
      |                                                                              unsigned int
      |                                                                          %I64lu
pfolder.c: In function ‘psync_list_get_list’:
pfolder.c:894:7: warning: variable ‘sqlLen’ set but not used [-Wunused-but-set-variable]
  894 |   int sqlLen;
      |       ^~~~~~
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pcloudcrypto.h:32,
                 from pfolder.c:36:
pssl.h: At top level:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o psyncer.o psyncer.c
In file included from pdownload.h:33,
                 from psyncer.c:35:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
psyncer.c: In function ‘psync_create_local_folder_in_db’:
psyncer.c:208:30: warning: ‘dbfolderid’ may be used uninitialized [-Wmaybe-uninitialized]
  208 |   if (lfolderid && dbfolderid!=folderid){
      |                    ~~~~~~~~~~^~~~~~~~~~
psyncer.c:156:31: note: ‘dbfolderid’ was declared here
  156 |   psync_folderid_t lfolderid, dbfolderid;
      |                               ^~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ptasks.o ptasks.c
In file included from pdownload.h:33,
                 from ptasks.c:30:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o psettings.o psettings.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from psettings.c:32:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pnetlibs.o pnetlibs.c
In file included from pnetlibs.c:34:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcache.o pcache.c
In file included from pcache.c:34:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pscanner.o pscanner.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o plist.o plist.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o plocalscan.o plocalscan.c
In file included from plocalscan.c:41:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o plocalnotify.o plocalnotify.c
plocalnotify.c: In function ‘add_dir_scan’:
plocalnotify.c:107:5: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
  107 |     while (!readdir_r(dh, entry, &de) && de)
      |     ^~~~~
In file included from /usr/include/features.h:491,
                 from /usr/include/sys/types.h:25,
                 from pcompat.h:110,
                 from plocalnotify.c:28:
/usr/include/dirent.h:191:12: note: declared here
  191 | extern int __REDIRECT (readdir_r,
      |            ^~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pp2p.o pp2p.c
In file included from pcrypto.h:31,
                 from pp2p.c:31:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcrypto.o pcrypto.c
In file included from pcrypto.h:31,
                 from pcrypto.c:29:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pssl.o pssl.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfileops.o pfileops.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ptree.o ptree.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ppassword.o ppassword.c
In file included from ppassword.c:31:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o prunratelimit.o prunratelimit.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pmemlock.o pmemlock.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pcloudcrypto.h:32,
                 from pmemlock.c:33:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pnotifications.o pnotifications.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pexternalstatus.o pexternalstatus.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o publiclinks.o publiclinks.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pbusinessaccount.o pbusinessaccount.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcontacts.o pcontacts.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o poverlay.o poverlay.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o poverlay_lin.o poverlay_lin.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o poverlay_mac.o poverlay_mac.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o poverlay_win.o poverlay_win.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcompression.o pcompression.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pasyncnet.o pasyncnet.c
In file included from pasyncnet.c:37:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ppathstatus.o ppathstatus.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from ppathstatus.c:31:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pdevice_monitor.o pdevice_monitor.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ptools.o ptools.c
ptools.c: In function ‘create_backend_event’:
ptools.c:206:3: warning: ‘keyParams’ may be used uninitialized [-Wmaybe-uninitialized]
  206 |   free(keyParams);
      |   ^~~~~~~~~~~~~~~
ptools.c:119:9: note: ‘keyParams’ was declared here
  119 |   char *keyParams;
      |         ^~~~~~~~~
ptools.c: In function ‘backend_call’:
ptools.c:271:22: warning: ‘localParams’ may be used uninitialized [-Wmaybe-uninitialized]
  271 |       localParams[i] = (binparam)P_BOOL(requiredParams->Params[i].paramname,
ptools.c:242:13: note: ‘localParams’ was declared here
  242 |   binparam *localParams;
      |             ^~~~~~~~~~~
ptools.c: In function ‘get_folder_name_from_path’:
ptools.c:597:10: warning: ‘folder’ may be used uninitialized [-Wmaybe-uninitialized]
  597 |   return strdup(folder);
      |          ^~~~~~~~~~~~~~
ptools.c:587:9: note: ‘folder’ was declared here
  587 |   char *folder;
      |         ^~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pssl-mbedtls.o pssl-mbedtls.c
In file included from pssl-mbedtls.c:30:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfs.o pfs.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pfs.c:31:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o ppagecache.o ppagecache.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from ppagecache.h:31,
                 from ppagecache.c:28:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfsfolder.o pfsfolder.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pcloudcrypto.h:32,
                 from pfsfolder.c:33:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfstasks.o pfstasks.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pfstasks.c:36:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfsupload.o pfsupload.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from ppagecache.h:31,
                 from pfsupload.c:37:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pintervaltree.o pintervaltree.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfsxattr.o pfsxattr.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcloudcrypto.o pcloudcrypto.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pcloudcrypto.h:32,
                 from pcloudcrypto.c:28:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
pcloudcrypto.c: In function ‘psync_cloud_crypto_start’:
pcloudcrypto.c:596:3: warning: ‘rsaprivlen’ may be used uninitialized [-Wmaybe-uninitialized]
  596 |   psync_ssl_memclean(rsaprivdec, rsaprivlen);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pcloudcrypto.c:509:22: note: ‘rsaprivlen’ was declared here
  509 |   size_t iterations, rsaprivlen, rsapublen, saltlen;
      |                      ^~~~~~~~~~
pcloudcrypto.c:577:19: warning: ‘rsapublen’ may be used uninitialized [-Wmaybe-uninitialized]
  577 |   crypto_pubkey = psync_ssl_rsa_load_public(rsapub, rsapublen);
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pcloudcrypto.c:509:34: note: ‘rsapublen’ was declared here
  509 |   size_t iterations, rsaprivlen, rsapublen, saltlen;
      |                                  ^~~~~~~~~
pcloudcrypto.c:586:12: warning: ‘saltlen’ may be used uninitialized [-Wmaybe-uninitialized]
  586 |   aeskey = psync_ssl_gen_symmetric_key_from_pass(
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  587 |       password, PSYNC_AES256_KEY_SIZE + PSYNC_AES256_BLOCK_SIZE, salt, saltlen,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  588 |       iterations);
      |       ~~~~~~~~~~~
pcloudcrypto.c:509:45: note: ‘saltlen’ was declared here
  509 |   size_t iterations, rsaprivlen, rsapublen, saltlen;
      |                                             ^~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfscrypto.o pfscrypto.c
In file included from pcrypto.h:31,
                 from pfs.h:39,
                 from pfscrypto.h:31,
                 from pfscrypto.c:29:
pssl.h:74:24: warning: ‘rsa_decr_mutex’ defined but not used [-Wunused-variable]
   74 | static pthread_mutex_t rsa_decr_mutex = PTHREAD_MUTEX_INITIALIZER;
      |                        ^~~~~~~~~~~~~~
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pcrc32c.o pcrc32c.c
gcc -Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite -DP_ELECTRON -fPIC -DP_OS_LINUX -D_FILE_OFFSET_BITS=64 -DP_SSL_MBEDTLS -I../mbedtls/include   -c -o pfsstatic.o pfsstatic.c
ar rcu psynclib.a pcompat.o psynclib.o plocks.o plibs.o pcallbacks.o pdiff.o pstatus.o papi.o ptimer.o pupload.o pdownload.o pfolder.o psyncer.o ptasks.o psettings.o pnetlibs.o pcache.o pscanner.o plist.o plocalscan.o plocalnotify.o pp2p.o pcrypto.o pssl.o pfileops.o ptree.o ppassword.o prunratelimit.o pmemlock.o pnotifications.o pexternalstatus.o publiclinks.o pbusinessaccount.o pcontacts.o poverlay.o poverlay_lin.o poverlay_mac.o poverlay_win.o pcompression.o pasyncnet.o ppathstatus.o pdevice_monitor.o ptools.o pssl-mbedtls.o pfs.o ppagecache.o pfsfolder.o pfstasks.o pfsupload.o pintervaltree.o pfsxattr.o pcloudcrypto.o pfscrypto.o pcrc32c.o pfsstatic.o plocks.o
ranlib psynclib.a

@lneely
Copy link
Author

lneely commented Jun 9, 2024

Same here, assumed the warnings were less important for now. This takes the first step in getting it working (I'm running it right now, in fact). Based on the commit history, it looks like this code has not been maintained for some time, so I expect there are a number of things still to do. (For the same reason, I'm actually surprised to see a comment on this PR. 😅 )

Anyhow, now that I know there are other users maybe I'll do a little more (e.g., perhaps create an Arch package for AUR), but going to keep this PR limited to "making it work" for now.

@asdf23
Copy link

asdf23 commented Jun 9, 2024

I tried to setup a headless machine, instead I setup some awful auto-login GUI- bash gnome-autostart thing.
Thanks for looking at it, I did give it a shot but failed miserably.

@lneely lneely changed the title fixed compile errors with gcc 14.x WIP: fixed compile errors with gcc 14.x Jun 9, 2024
@lneely
Copy link
Author

lneely commented Jun 9, 2024

Marked as WIP. startcrypto is broken, need to fix.

@lneely lneely changed the title WIP: fixed compile errors with gcc 14.x fixed compile errors with gcc 14.x Jun 9, 2024
@lneely lneely changed the title fixed compile errors with gcc 14.x WIP: fixed compile errors with gcc 14.x Jun 9, 2024
@coxackie
Copy link

@lneely There is the AUR package https://aur.archlinux.org/packages/pcloudcc-git that I was maintaining, tracking the main branch here. Do you want me to add you as maintainer in order to track your commits? I am not very invested in the package anymore, as I am using pcloud very sparingly, but the cli is much better than the overbloated electron app, so an active maintainer would be great.

@lneely
Copy link
Author

lneely commented Jun 10, 2024

@coxackie Beyond this I didn't plan on doing much else, but what the hell; it will give me something to do, and I wouldn't mind helping out. Please bear with me as I learn, because I've never actually maintained an AUR package or any package for that matter.

@asdf23
Copy link

asdf23 commented Jun 10, 2024

Confirmed, this is compiling better for me

@lneely
Copy link
Author

lneely commented Jun 10, 2024

It's a process, was more broken than I thought it was. Starting to feel some ass pain.

@lneely
Copy link
Author

lneely commented Jun 15, 2024

Fixed the original segfault I was hunting, was apparently caused by writing outside some array boundaries. Now hunting another one.

@lneely
Copy link
Author

lneely commented Jun 15, 2024

OK! fixed the segfaults I found. @asdf23, also resolved some additional compilation warnings. I think this is ready for merge.

@lneely lneely changed the title WIP: fixed compile errors with gcc 14.x fixed compile errors and segfaults with gcc 14.x Jun 15, 2024
@lneely
Copy link
Author

lneely commented Jun 15, 2024

@coxackie let me know if you still want a maintainer for the AUR package. If this repo isn't active anymore, and I suspect it may not be, I might just maintain the code independently.

@tomash
Copy link

tomash commented Jun 15, 2024

Confirming that lneely:master branch builds, runs and works on Manjaro. Having this in AUR package would be great.

@coxackie
Copy link

@coxackie let me know if you still want a maintainer for the AUR package. If this repo isn't active anymore, and I suspect it may not be, I might just maintain the code independently.

@lneely are you registered with AUR? if yes, what is your username?

@lneely
Copy link
Author

lneely commented Jun 20, 2024

@coxackie I just registered, my username is lkn.

@lneely lneely mentioned this pull request Jun 24, 2024
@lneely
Copy link
Author

lneely commented Jun 24, 2024

To all interested: it has now been over 2 weeks, and this PR seem to have fallen into the same void as the 14 other open PRs (some of which are years old). Despite this, I will keep the PR open in case this repo ever sees any more activity.

At the same time, I've created my own independent fork of console-client with a boring name because I'm lazy. I promise to maintain it as inconsistently and haphazardly as I do all the other code I don't get paid to work on.

https://github.com/lneely/pcloudcc-lneely/

@asdf23 @tomash

@asdf23
Copy link

asdf23 commented Jun 26, 2024

I don't know where to post this. This tool makes pcloud 10 times more valuable. PCloud should be paying you for this. That company has really lost there way. It's a shame. That password mgmt tool they came out with recently is garbage. There's a major bug in it, they are not addressing it, not going to address it. I do have a contact over there, I'll try to reach out to them.
I appreciate it.

@lneely
Copy link
Author

lneely commented Jun 26, 2024

@asdf23 🍻 I already get paid to code, just not by pcloud. I'm just happy that the client is free software so this is possible to do. Not many companies do this, and it was a big reason I chose pcloud.

@asdf23
Copy link

asdf23 commented Jun 26, 2024

@lneely that's not at all surprising :)

But at issue is pCloud taking responsibility for their code. For instance if they introduce a new feature (like 2FA) this thing all goes down, and I doubt they'd even be aware of the impact.

What's even more ridiculous is that this tool could be it's own feature - a bullet point on the list of why pCloud is better than the various competitors. Instead we are seeing their "values in action".

arghh

@tomash
Copy link

tomash commented Jul 2, 2024

@lneely your own fork with its own name sounds like a plan, pcloud team can always come back and merge back your code into theirs. I'm a software developer myself -- can you setup a github sponsorship or any other way to chip in small monthly amounts to express appreciation of your spare-time work on this?

Keeping with the compilation errors, I just got a new toy, ClockworkPi uConsole which is basically a device that turns Raspberry Pi CM4 into a laptop. The operating system that came with it is Raspberry OS based on Debian 11 with kernel 5.10.17 and gcc 10.2.1, all in all pretty ancient. I've built your fork successfully on it and it works (thank you once again), but I before getting there the make was failing with the error message core2 is not a valid option for mtune, I had to edit lib/pclsync/Makefile and change the relevant part of CFLAGS to -mtune=cortex-a72. Just reporting here, not sure if it's worth fixing given those ancient versions.

@lneely
Copy link
Author

lneely commented Jul 2, 2024

@tomash much appreciated, really, but I would have to check the German immigration laws before I could do anything like that. Depends, for example, if it counts as a form of "self employment," which is not currently allowed under the terms of my residence permit.

I will copy and paste what you've reported here into my fork and tag you there so I can more easily track it. While I don't have a raspberry pi myself, perhaps I can simulate the environment.

Right now I'm in "seek and destroy" mode to make my job easier. This will likely take some time, but happy to try and look into it whenever I can. There might be a decent systematic way to support that case. (Trying to avoid special cases like the plague)

🍻

@lneely
Copy link
Author

lneely commented Aug 19, 2024

Closing due to maintainer inactivity.

Forked to https://github.com/lneely/pcloudcc-lneely

@lneely lneely closed this Aug 19, 2024
@asdf23
Copy link

asdf23 commented Aug 19, 2024

If @pcloudcom isn't going to maintain the software it constitutes a misleading representation of the product's capabilities. Which could potentially constitute false advertising and deceptive trade practices. I wonder if pCloud could be bothered to edit the HTML with the misleading claim. Or perhaps we can find someone here on github that would update the HTML for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants