Passing reference into varargs

Issue #91 resolved
Richard Roberts created an issue

Hi Frank, I'm assigning this to you since I think you added this code, but whichever one of us ( CC @cbeall3 ) has time first can take a look:

/Users/richard/borg/gtsam/gtsam.git/gtsam/base/Vector.cpp:46:18: warning: 'va_start' has undefined
      behavior with reference types [-Wvarargs]
  va_start(args, stream);
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/include/stdarg.h:33:52: note: 
      expanded from macro 'va_start'
#define va_start(ap, param) __builtin_va_start(ap, param)
                                                   ^
/Users/richard/borg/gtsam/gtsam.git/gtsam/base/Vector.cpp:42:45: note: parameter of type 'ostream &'
      (aka 'basic_ostream<char> &') is declared here
void odprintf_(const char *format, ostream& stream, ...) {
                                            ^
1 warning generated.

Comments (3)

  1. Chris Beall

    It looks like this actually causes a crash on 32-bit Windows which @scamp39 ran into. Is there a good reason why we have these functions instead of just printing Vectors & Matrices directly? I think these functions are probably just left over from before the switch to Eigen and can go away?

  2. Log in to comment