Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosconsole: cannot print variables named "enabled" or "loc" #442

Closed
xqms opened this issue Jun 17, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@xqms
Copy link
Contributor

commented Jun 17, 2014

I've got a funny one for you:

bool enabled = false;
ROS_ERROR("enabled: %d", enabled);

What would you expect? Certainly not this:

enabled: 1

The culprit is the ROSCONSOLE_DEFINE_LOCATION() macro here. It defines local variables enabled and loc, which then shadow parameters which have the same name.

I propose changing the names of those variables to something less general (__rosconsole__enabled?).

Bug was found by my colleague Philipp Allgeuer (@pallgeuer).

@dirk-thomas dirk-thomas added the bug label Jun 17, 2014

dirk-thomas added a commit that referenced this issue Jun 17, 2014

dirk-thomas added a commit to ros/rosconsole_bridge that referenced this issue Jun 17, 2014

@dirk-thomas dirk-thomas self-assigned this Jun 17, 2014

dirk-thomas added a commit to ros/rosconsole_bridge that referenced this issue Jun 17, 2014

@xqms

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2014

Thanks, that was quick!

@dirk-thomas

This comment has been minimized.

Copy link
Member

commented Jun 17, 2014

Thanks for pointing it out.

severin-lemaignan pushed a commit to severin-lemaignan/robotpkg that referenced this issue Aug 18, 2014

Anthony Mallet
[sysutils/ros-console-bridge] Update to 0.4.2
Changes since 0.2.7:

0.4.2 (2014-07-18)
------------------
* update maintainers

0.4.1 (2014-06-25)
------------------
* update find_package for console bridge to reflect 3rdparty status (`#8
<https://github.com/ros/rosconsole_bridge/issues/8>`_)

0.4.0 (2014-06-24)
------------------
* rename variables within rosconsole macros (`ros/ros_comm#442
<https://github.com/ros/ros_comm/issues/442>`_)
* convert to use console bridge from upstream debian package
(`ros/rosdistro#4633 <https://github.com/ros/rosdistro/issues/4633>`_)

0.3.4 (2014-02-15)
------------------
* Allows non-ros components to utilize the prefix functionality of log4j
* Contributors: Dave Coleman, Ioan A Sucan

0.3.3 (2013-08-21)
------------------
* fixing catkin as a buildtool dependency
* Contributors: Dirk Thomas, Tully Foote

0.3.2 (2013-04-12)
------------------
* changes due to renames in console_bridge
* Contributors: Ioan Sucan

0.3.1 (2013-03-13 21:24)
------------------------
* fix deps
* update e-mail address
* Contributors: Ioan Sucan

Dropped patch-aa applied upstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.