[Saturn-Next] Lots of C++ related warnings when compiling #192

Closed
opened 2025-07-26 18:53:21 +02:00 by chromaticpipe · 4 comments
chromaticpipe commented 2025-07-26 18:53:21 +02:00 (Migrated from github.com)

When compiling latest Saturn Next I get a bunch of warnings about certain warning flags not being in C++

cc1plus: warning: command-line option ‘-Wbad-function-cast’ 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 ‘-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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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++

For some reason the Makefile tries to pass the warning flags to g++ even if they aren't available.

Image
When compiling latest Saturn Next I get a bunch of warnings about certain warning flags not being in C++ ``` cc1plus: warning: command-line option ‘-Wbad-function-cast’ 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 ‘-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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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: command-line option ‘-Wold-style-definition’ 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++ ``` For some reason the Makefile tries to pass the warning flags to g++ even if they aren't available. <img width="659" height="166" alt="Image" src="https://github.com/user-attachments/assets/00cb3723-eafc-42a7-abea-4f5fce4edefb" />
alufolie91 commented 2025-07-26 19:54:03 +02:00 (Migrated from github.com)

well currently all build flags gets passed to both c and c++ compiler, this does not do any harm and was mostly done for simplicity sake (didnt want to introduce any weird bugs when splitting things up)
but it is planned to fix this in the future

well currently all build flags gets passed to both c and c++ compiler, this does not do any harm and was mostly done for simplicity sake (didnt want to introduce any weird bugs when splitting things up) but it is planned to fix this in the future
alufolie91 commented 2025-08-02 01:57:19 +02:00 (Migrated from github.com)

should be fixed now c:
could you also recheck just in case?

should be fixed now c: could you also recheck just in case?
chromaticpipe commented 2025-08-02 02:44:17 +02:00 (Migrated from github.com)

should be fixed now c: could you also recheck just in case?

Can confirm there's no warnings now.

> should be fixed now c: could you also recheck just in case? Can confirm there's no warnings now.
alufolie91 commented 2025-08-02 18:21:40 +02:00 (Migrated from github.com)

alr neat! hope i didnt mess anything up with this lol, thanks for report! :)

alr neat! hope i didnt mess anything up with this lol, thanks for report! :)
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: saturn/SRB2Kart-Saturn#192