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

Default warnings-as-errors behavior breaks build on non-Windows platforms #28

Open
qwertychouskie opened this issue Jun 11, 2024 · 2 comments

Comments

@qwertychouskie
Copy link

The warnings that become errors:

> Task :compileCANBridgeOsxuniversalReleaseSharedLibraryCANBridgeCpp
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/cpp/Drivers/Serial/SerialDriver.cpp:32:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDevice.h:34:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDeviceThread.h:48:
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:65:9: error: field 'm_threadIntervalMs' will be initialized after field 'm_counter' [-Werror,-Wreorder-ctor]
        m_threadIntervalMs(threadIntervalMs),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        m_counter(counter)
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:80:46: error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
            if (element.m_msg.GetMessageId() == targetId) {
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:88:174: error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'const int' [-Werror,-Wsign-compare]
        m_sendQueue.erase(std::remove_if(m_sendQueue.begin(), m_sendQueue.end(), [targetId](detail::CANThreadSendQueueElement element) { return element.m_msg.GetMessageId() == targetId; }), m_sendQueue.end());
                                                                                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:154:51: error: parameter 'details' set but not used [-Werror,-Wunused-but-set-parameter]
    void GetCANStatus(rev::usb::CANStatusDetails* details) {
                                                  ^
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/cpp/Drivers/Serial/SerialDriver.cpp:32:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDevice.h:34:
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDeviceThread.h:117:10: error: 'ReadMessages' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    void ReadMessages(bool &reading)  {
         ^
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:199:18: note: overridden virtual function is here
    virtual void ReadMessages(bool &reading) = 0;
                 ^
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/cpp/Drivers/Serial/SerialDriver.cpp:32:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDevice.h:34:
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDeviceThread.h:184:10: error: 'WriteMessages' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    bool WriteMessages(detail::CANThreadSendQueueElement el, std::chrono::steady_clock::time_point now) {
         ^
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:200:18: note: overridden virtual function is here
    virtual bool WriteMessages(detail::CANThreadSendQueueElement element, std::chrono::steady_clock::time_point now) = 0;
                 ^
6 errors generated.

In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/cpp/Drivers/Serial/SerialDevice.cpp:30:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDevice.h:34:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDeviceThread.h:48:
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:65:9: error: field 'm_threadIntervalMs' will be initialized after field 'm_counter' [-Werror,-Wreorder-ctor]
        m_threadIntervalMs(threadIntervalMs),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        m_counter(counter)
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:80:46: error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]
            if (element.m_msg.GetMessageId() == targetId) {
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:88:174: error: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'const int' [-Werror,-Wsign-compare]
        m_sendQueue.erase(std::remove_if(m_sendQueue.begin(), m_sendQueue.end(), [targetId](detail::CANThreadSendQueueElement element) { return element.m_msg.GetMessageId() == targetId; }), m_sendQueue.end());
                                                                                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:154:51: error: parameter 'details' set but not used [-Werror,-Wunused-but-set-parameter]
    void GetCANStatus(rev::usb::CANStatusDetails* details) {
                                                  ^
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/cpp/Drivers/Serial/SerialDevice.cpp:30:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDevice.h:34:
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDeviceThread.h:117:10: error: 'ReadMessages' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    void ReadMessages(bool &reading)  {
         ^
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:199:18: note: overridden virtual function is here
    virtual void ReadMessages(bool &reading) = 0;
                 ^
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/cpp/Drivers/Serial/SerialDevice.cpp:30:
In file included from /Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDevice.h:34:
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/SerialPort/SerialDeviceThread.h:184:10: error: 'WriteMessages' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    bool WriteMessages(detail::CANThreadSendQueueElement el, std::chrono::steady_clock::time_point now) {
         ^
/Users/[user]/unofficial-rev-port/CANBridge/src/main/native/include/rev/Drivers/DriverDeviceThread.h:200:18: note: overridden virtual function is here
    virtual bool WriteMessages(detail::CANThreadSendQueueElement element, std::chrono::steady_clock::time_point now) = 0;
                 ^
6 errors generated.
@garrettsummerfi3ld
Copy link

Should be resolved in #29

@qwertychouskie
Copy link
Author

Should be resolved in #29

In #29, the warnings-as-errors is just disabled as far as I remember, really we should actually fix the errors.

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

No branches or pull requests

2 participants