Skip to content

Fix: Enable successful build on macOS (AppleClang)#22

Merged
berndpfrommer merged 2 commits intoros-event-camera:masterfrom
idesign0:master
Sep 16, 2025
Merged

Fix: Enable successful build on macOS (AppleClang)#22
berndpfrommer merged 2 commits intoros-event-camera:masterfrom
idesign0:master

Conversation

@idesign0
Copy link
Contributor

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-parameter compiler 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-override compiler error, adhering to modern C++ best practices.

  • Platform-Specific Endianness Fix: Implements a conditional include for macOS to use native endian macros 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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really attached to those flags ...
How hard is it to fix the unused parameter errors?
Could you please post the error messages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@berndpfrommer,

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!");
}
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can fix this by either removing the variable names, or (preferred) by doing
(void)codec;
...etc...
inside the function body.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for comments. i will be on it.

@berndpfrommer
Copy link
Collaborator

Thank you for this PR! Please see comments.

@berndpfrommer berndpfrommer merged commit e03b396 into ros-event-camera:master Sep 16, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants