Skip to content

Do not pass C++ warning options to C compiler#219

Merged
ChrisThrasher merged 1 commit intoSFML:masterfrom
kimci86:bugfix/c++_warnings_in_c
Dec 21, 2023
Merged

Do not pass C++ warning options to C compiler#219
ChrisThrasher merged 1 commit intoSFML:masterfrom
kimci86:bugfix/c++_warnings_in_c

Conversation

@kimci86
Copy link
Contributor

@kimci86 kimci86 commented Dec 21, 2023

GCC outputs warnings about C++ flags when compiling the C example.

cc1: warning: command-line option ‘-Wnon-virtual-dtor’ is valid for C++/ObjC++ but not for C
cc1: warning: command-line option ‘-Woverloaded-virtual’ is valid for C++/ObjC++ but not for C
cc1: warning: command-line option ‘-Wold-style-cast’ is valid for C++/ObjC++ but not for C

Using CMake generator expression COMPILE_LANGUAGE to make some flags active only when compiling C++ solves it.

@ChrisThrasher ChrisThrasher merged commit 0601d5f into SFML:master Dec 21, 2023
@kimci86 kimci86 deleted the bugfix/c++_warnings_in_c branch December 22, 2023 08:23
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.

3 participants