Skip to content

cmake: pass picky C options to C targets only (and not to C++ ossfuzz) - #1686

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:cpp
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:cpp

Conversation

@vszakats

@vszakats vszakats commented Sep 27, 2025 •

Copy link
Copy Markdown
Member

This also means that we no longer pass any picky warning option to
ossfuzz. It's probably not worth maintaining picky C++ options for this
single, small target.

Silencing:

cc1plus: warning: command-line option '-Wbad-function-cast' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wenum-int-mismatch' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wjump-misses-init' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wmissing-parameter-type' 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 '-Wold-style-declaration' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wold-style-definition' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++

Ref: https://github.com/libssh2/libssh2/actions/runs/18063134305/job/51402236388#step:7:15

@vszakats vszakats added the build label Sep 27, 2025
@vszakats vszakats changed the title cmake: fix to not pass picky C warning options to the fuzzer (C++) cmake: do not pass picky C options to C++ targets (ossfuzz) Sep 27, 2025
@vszakats vszakats changed the title cmake: do not pass picky C options to C++ targets (ossfuzz) cmake: pass picky C options to C targets only (and not to C++ ossfuzz) Sep 27, 2025
@vszakats vszakats closed this in 14a709a Sep 27, 2025
@vszakats
vszakats deleted the cpp branch September 27, 2025 19:51
vszakats added a commit to vszakats/libssh2 that referenced this pull request Sep 28, 2025
vszakats added a commit that referenced this pull request Sep 29, 2025
- prefer `set_property()` over `target_compile_options()`, to use
  the modern style.

  Follow-up to 8017592 #939

- prefer to append to compiler/linker options in examples/tests.
  To prevent accidentally overriding a previously set option.

  Follow-up to 14a709a #1686
  Follow-up to 854cfa8 #1524

- replace `LINK_FLAGS` with `LINK_OPTIONS` that superceded it, for
  CMake 3.13+.

  Follow-up to 854cfa8 #1524
  https://cmake.org/cmake/help/v4.1/prop_tgt/LINK_OPTIONS.html

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant