On 4. 6. 2026 12:45, Ivan Zhakov wrote:
On Mon, 1 Jun 2026 at 18:17, <[email protected]> wrote:

    Author: rinrab
    Date: Mon Jun  1 16:17:41 2026
    New Revision: 1934847

    Log:
    Setup GCC warnings for cmake build.

    The warning flags are shamelessly stolen from configure.ac
    <http://configure.ac>.

    * CMakeLists.txt
      (#warnings): Move this section up before targets.cmake and add
    an else() case
       that adds all the GCC flags.
      (SVN_CFLAGS_ADD_IFELSE): Add a function that checks if a flag is
    supported by
       the compiler and then adds it via add_compile_options().

    Modified:
       subversion/trunk/CMakeLists.txt

It seems that new warnings started to trigger after this commit on Linux:
https://github.com/apache/subversion/actions/runs/26938816858/job/79475377904
[[[
[449/706] Building CXX object CMakeFiles/libsvn_auth_kwallet.dir/subversion/libsvn_auth_kwallet/kwallet.cpp.o cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command-line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command-line option ‘-Wnested-externs’ is valid for C/ObjC but not for C++ cc1plus: warning: command-line option ‘-Wbad-function-cast’ is valid for C/ObjC but not for C++ cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++ cc1plus: warning: ‘-Werror=’ argument ‘-Werror=declaration-after-statement’ is not valid for C++ cc1plus: warning: command-line option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++ /home/runner/work/subversion/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp: In function ‘svn_error_t* kwallet_password_get(svn_boolean_t*, const char**, apr_hash_t*, const char*, const char*, apr_hash_t*, svn_boolean_t, apr_pool_t*)’: /home/runner/work/subversion/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp:219:21: warning: variable ‘app’ set but not used [-Wunused-but-set-variable]
  219 |   QCoreApplication *app;
      |                     ^~~
/home/runner/work/subversion/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp: In function ‘svn_error_t* kwallet_password_set(svn_boolean_t*, apr_hash_t*, const char*, const char*, const char*, apr_hash_t*, svn_boolean_t, apr_pool_t*)’: /home/runner/work/subversion/subversion/subversion/libsvn_auth_kwallet/kwallet.cpp:301:21: warning: variable ‘app’ set but not used [-Wunused-but-set-variable]
  301 |   QCoreApplication *app;
      |                     ^~~
]]]

Also I suggest cross-referencing configure.ac <http://configure.ac> and CMakeLists.txt to keep warnings list in sync.

Good catch. The actual reference would be build/ac-macros/compiler.m4. It keeps a separate list of warning options for C and C++, not a single list for both languages.

-- Brane

Reply via email to