Skip to content

Compile flag fixes - #530

Closed
jpsamper2009 wants to merge 2 commits into
ros2:masterfrom
ApexAI:compile-flag-fixes
Closed

jpsamper2009 wants to merge 2 commits into
ros2:masterfrom
ApexAI:compile-flag-fixes

Conversation

@jpsamper2009

@jpsamper2009 jpsamper2009 commented Aug 9, 2018 •

Copy link
Copy Markdown

Description

  • Courtesy of @serge-nikulin
  • This PR fixes warning generated when building with:
-Wall
-Wextra
-pedantic
-Wcast-align
-Wunused
-Wconversion
-Wsign-conversion
-Wdouble-promotion
-fvisibility=hidden

connects to ros2/rcutils#114

@esteve esteve added the in review Waiting for review (Kanban column) label Aug 9, 2018
@esteve esteve removed the in review Waiting for review (Kanban column) label Aug 20, 2018
@mikaelarguedas mikaelarguedas added the in review Waiting for review (Kanban column) label Aug 20, 2018
} // namespace node_interfaces

class ClientBase
class RCLCPP_PUBLIC ClientBase

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you explain a little bit about what this improves? I don't have any particular knowledge, so a little description of why making the class public instead of the methods would be helpful for me to understand.


if (abs_scale > 1.0 && abs_dns > static_cast<uint64_t>(max / abs_scale)) {
if ((dns > 0 && scale > 0) || (dns < 0 && scale < 0)) {
long double max_ld = static_cast<long double>(max);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we actually need the extra precision of a long double here? I'm particularly worried that this will have a performance impact because this will probably end up calling software long double routines. Further, we already know that (in the one and only caller to this), that max is going to be std::numeric_limites<rcl_duration_value_t>::max(), so probably INT64_MAX, which I don't think we need to store in a long double. I haven't fully thought through all of the implications here, so I'm glad to hear arguments about why a long double would be needed.

throw std::runtime_error(
std::string("Failed to set SIGINT signal handler: (" + std::to_string(errno) + ")") +
error_string);
std::string error_message("Failed to set SIGINT signal handler: (");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any particular reason for this change?


std::vector<std::string> return_arguments;
return_arguments.resize(nonros_argc);
return_arguments.resize(static_cast<uint32_t>(nonros_argc));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return_arguments.resize(static_cast<uint32_t>(nonros_argc));

for (int ii = 0; ii < nonros_argc; ++ii) {
for (uint32_t ii = 0U; ii < static_cast<uint32_t>(nonros_argc); ++ii) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we are casting nonros_argc to a number twice, we should probably just store it above and reuse it rather than continually casting. This may also change to size_t based on the previous comment.

@mabelzhang mabelzhang added backlog and removed in review Waiting for review (Kanban column) labels Sep 19, 2019
@jpsamper2009

Copy link
Copy Markdown
Author

This PR was a for a much older version of the code. I'll close it and readdress with a newer version (if the issues still exist).

@clalancette

Copy link
Copy Markdown
Contributor

This PR was a for a much older version of the code. I'll close it and readdress with a newer version (if the issues still exist).

I'm actually closing this for now. @jpsamper2009 feel free to reopen if you disagree.

nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
…os2#530)

* Fixes ros2#464 - caches by message size and not message count

Signed-off-by: Jaison Titus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants