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

effort_display.h causing compile time error #3

Open
victl opened this issue May 22, 2016 · 1 comment
Open

effort_display.h causing compile time error #3

victl opened this issue May 22, 2016 · 1 comment

Comments

@victl
Copy link

victl commented May 22, 2016

Hi, there
I'm compiling rviz on my dev-machine. But it seemed an error in the file src/rviz/default_plugin/effort_display.h
on line 39 & 45:

    ROS_DEBUG_NAMED("message_filter", "MessageFilter [target=%s]: "fmt, getTargetFramesString().c_str(), __VA_ARGS__)

seemed like a comma is missing just before fmt.
I added a comma myself and the compile errors are gone. So I'd confirm it's a bug(or typo, maybe).

PS, some env specs:
System: Archlinux
gcc version: 6.1.1
ros version: jade
rviz version: 1.12.1
I was trying to install ros-jade via AUR packages, and the errors emerged. Gook luck Arch guys : )

@victl
Copy link
Author

victl commented May 22, 2016

well, maybe it's a c++11 issue. As I test this snippet with my compiler:

#include <stdio.h>
#define PRINT_ERROR(m) fprintf(stderr, "it's a shit:"m" , (%s %s)\n", __FILE__, __FUNCTION__)

int main(int argc, char *argv[])
{
    PRINT_ERROR("Ahhhh");
    return 0;
}

I get this error:

/home/victor/Workspace/playground/boost/src/main.cpp:2: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
#define PRINT_ERROR(m) fprintf(stderr, "it's a shit:"m" , (%s %s)\n", __FILE__, __FUNCTION__)
                                                     ^

Note it says C++11 requires a space between..., so adding this space would eliminate the error.

PS: The compiler is clang (instead of g++ when building rviz using cmake). You could see the difference of error messages. clang clearly tells you what the error is, pointing a right way to solve it, while g++ just complain something like this:

/home/victor/Workspace/playground/boost/src/main.cpp:2: error: unable to find string literal operator 'operator""m' with 'const char [24]', 'long unsigned int' arguments
 #define PRINT_ERROR(m) fprintf(stderr, "it's a shit:"m" , (%s %s)\n", __FILE__, __FUNCTION__)
                                                       ^

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

No branches or pull requests

1 participant