Fix: Enable successful build on macOS (AppleClang)#22
Fix: Enable successful build on macOS (AppleClang)#22berndpfrommer merged 2 commits intoros-event-camera:masterfrom
Conversation
There was a problem hiding this comment.
I'm really attached to those flags ...
How hard is it to fix the unused parameter errors?
Could you please post the error messages?
There was a problem hiding this comment.
ros-event-camera/event_camera_codecs/include/event_camera_codecs/decoder_factory.h:55:57: error: unused parameter 'height', 'weight', 'codec' [-Werror,-Wunused-parameter]
55 | const std::string & codec, uint16_t width, uint16_t height)
// (deprecated) factory method to get decoder from shared pool
Decoder<MsgT, EventProcT> * getInstance(
const std::string & codec, uint16_t width, uint16_t height)
{
throw std::runtime_error("no decoder available for this message type!");
}
};
There was a problem hiding this comment.
You can fix this by either removing the variable names, or (preferred) by doing
(void)codec;
...etc...
inside the function body.
There was a problem hiding this comment.
thanks for comments. i will be on it.
|
Thank you for this PR! Please see comments. |
This pull request resolves several compiler and C++ standard-compliance issues to enable a successful build on macOS using the AppleClang compiler. The changes address three distinct problems that were causing the build to fail.
Compiler Warning Fix: Adds the
-Wno-unused-parametercompiler flag to suppress warnings about intentionally unused function parameters. These warnings were being treated as errors, preventing the build from completing.C++ Virtual Override Fix: Adds the override keyword to a virtual function that was incorrectly missing it. This resolves a
winconsistent-missing-overridecompiler error, adhering to modern C++ best practices.Platform-Specific Endianness Fix: Implements a conditional include for macOS to use native
endianmacros from<libkern/OSByteOrder.h>.The build was previously failing on macOS because it was attempting to use Linux-specific endian macros (htole32,le32toh,etc.) which are not available on Apple platforms.fyi, @traversaro.