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

Include stdarg.h unconditionally in StringUtil.cpp #17

Closed
wants to merge 1 commit into from

Conversation

meyerj
Copy link
Member

@meyerj meyerj commented Jul 25, 2019

This might fix a compile error with GCC 5.5:

/home/travis/build/orocos-toolchain/orocos_toolchain/log4cpp/src/StringUtil.cpp: In static member function ‘static std::__cxx11::string log4cpp::StringUtil::vform(const char*, __va_list_tag*)’:
/home/travis/build/orocos-toolchain/orocos_toolchain/log4cpp/src/StringUtil.cpp:47:36: error: ‘va_copy’ was not declared in this scope
             va_copy(args_copy, args);
                                    ^

Edit: This error also occurs with the default GCC version 5.4 in Ubuntu Xenial when building without C++11 support enabled.

This might fix a compile error with gcc 5.5:

/home/travis/build/orocos-toolchain/orocos_toolchain/log4cpp/src/StringUtil.cpp: In static member function ‘static std::__cxx11::string log4cpp::StringUtil::vform(const char*, __va_list_tag*)’:
/home/travis/build/orocos-toolchain/orocos_toolchain/log4cpp/src/StringUtil.cpp:47:36: error: ‘va_copy’ was not declared in this scope
             va_copy(args_copy, args);
                                    ^
@meyerj
Copy link
Member Author

meyerj commented Jul 25, 2019

The patch does not fix the problem. For some reason LOG4CPP_HAVE_SNPRINTF is not defined.
Might be related to #14 because I am building with ccache.

@meyerj
Copy link
Member Author

meyerj commented Jul 25, 2019

va_copy was only added to C++ in C++11.
If you compile without -std=c++03 or with -std=gnu++03, va_copy is defined.

@meyerj meyerj closed this Jul 25, 2019
@meyerj meyerj deleted the fix-stdarg-include branch July 25, 2019 19:08
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

Successfully merging this pull request may close these issues.

1 participant