You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compile with stricter compiler options where it's not too cumbersome #305
follow up of ros2/rclcpp#253
I created pedantic branch for most ros2 specific repos. This branch simply passes -Wpedantic to GCC and CLANG
The goal of the issue is to keep track of which packages don't comply with stricter rules and the reason why. This is also a place to gather feedback on which ones are worth changing to comply with stricter compiler rules.
Packages not patched (yet ?): class_loader and every package depending on it: - trying to diverge as less as possible from master to facilitate backports later on: - class_loader: now compiles with pedantic
the memory tools redefine a bunch of memory functions (malloc, realloc etc) but without the proper flags and attributes so build fails with pedantic. It may be cumbersome to fix if we need to add compiler/platform specific logic to support this flag
rclpy:
pedantic doesn't like casting pointers <=> function pointers. This is used to retrieve all the C functions used to convert data between C and Python
tlsf_cpp:
uses VLAs, should be fixable but haven't find an elegant way to do it yet
ros1_bridge:
uses ROS1 messages, ROS1 message generation doesn't comply with pedantic
Except from those packages, CI is passing without warning on gcc and clang.
Linux:
OSX:
I also gave a try to also pass /W4 to MSVC
as expected MSVC is spitting a lot more warnings on about every package. Some of them are legit and will be addressed. But I think that a good amount could/should be ignored.
Windows:
Iterating on this (updating the first comment of this issue as things moves forward): message packages can use this flag for c++, the blocker is still that the Cpython code uses object pointer to function pointer conversion for all the type conversion functions:
geometry2: ros/geometry2@72b7072
common_interfaces: ros2/common_interfaces@4a5c9e3
rcl_interfaces: ros2/rcl_interfaces@dd78248
Between the work that Mikael did here, and the more recent work that Audrow did, we've enabled a lot of warnings on a lot of packages. While we can go further, that is always the case, so I'm going to consider this "done". If there are additional flags we should enable on specific packages, we'll open up separate issues for each of them for easier tracking.
Activity
mikaelarguedas commentedon Feb 10, 2017
Here is a a first iteration for pedantic (Linux, OSX), I put only commit whent we just have to add the flag and opened PR where there is code change.
CI:
wjwwood commentedon Feb 28, 2017
I only had comments on one of the linked set of changes, lgtm.
mikaelarguedas commentedon Feb 28, 2017
reran CI for all these branch:
mikaelarguedas commentedon Mar 2, 2017
Iterating on this (updating the first comment of this issue as things moves forward):
message packages can use this flag for c++, the blocker is still that the Cpython code uses object pointer to function pointer conversion for all the type conversion functions:
geometry2: ros/geometry2@72b7072
common_interfaces: ros2/common_interfaces@4a5c9e3
rcl_interfaces: ros2/rcl_interfaces@dd78248
One demo was not using extra or pedantic:
demos: ros2/demos@af0699d
rmw_connext_dynamic_cpp: ros2/rmw_connext#219
rmw_opensplice (now that it compiles again): ros2/rmw_opensplice#163
CI (without tests only to identify warnings):
mikaelarguedas commentedon Mar 24, 2017
CI with rebased branches and addressed review comments:
mikaelarguedas commentedon Mar 8, 2018
class_loader now complies as well: ros/class_loader#80
mikaelarguedas commentedon Sep 20, 2018
Message packages now compile with pedantic:
ros-planning/navigation_msgs@7a7d12c
ros2/demos@0ca06c9
ros2/example_interfaces@aebff12
ros2/geometry2@80ee9d6
ros2/rcl_interfaces@5b561bf
ros2/rclcpp@f6c2f5b
ros2/rcutils@1bb9cc6
ros2/system_tests@d54981b
ros2/common_interfaces#59
CI at: ros2/common_interfaces#59 (comment)
clalancette commentedon Jan 7, 2021
Between the work that Mikael did here, and the more recent work that Audrow did, we've enabled a lot of warnings on a lot of packages. While we can go further, that is always the case, so I'm going to consider this "done". If there are additional flags we should enable on specific packages, we'll open up separate issues for each of them for easier tracking.