Skip to content

Commit 20e56b1

Browse files
authored
Suppress deprecation warning for ament_index API (#804)
### Changelog None ### Docs None ### Description Temporarily suppress deprecation warnings for `get_package_share_directory`, which will cause ROS2 buildfarm builds to pass for Foxglove Bridge. These suppressions will be reverted in #803 once ament/ament_index#105 has merged and ROS packages have synced. Fixes: FLE-165 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Temporarily mutes deprecation warnings to unblock ROS2 builds. > > - Wraps `ament_index_cpp::get_package_share_directory` call in `message_definition_cache.cpp` with GCC pragmas to ignore `-Wdeprecated-declarations` > - Adds TODO noting removal after `ament_index_cpp` update (FLE-167) > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 14325f4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 64bcb9a commit 20e56b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ros/src/foxglove_bridge/src/message_definition_cache.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ const MessageSpec& MessageDefinitionCache::load_message_spec(
215215
}
216216

217217
// Get the package share directory, or throw a PackageNotFoundError
218+
// TODO: FLE-167: Remove warning once ament_index_cpp is updated and synced across all current
219+
// ROS2 distributions.
220+
#pragma GCC diagnostic push
221+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
218222
const std::string share_dir = ament_index_cpp::get_package_share_directory(package);
223+
#pragma GCC diagnostic pop
219224

220225
// Get the rosidl_interfaces index contents for this package
221226
std::string index_contents;

0 commit comments

Comments
 (0)