Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

tools/tracer: fails to build with libc++ #2209

Closed
jbeich opened this issue Jul 10, 2020 · 0 comments · Fixed by #2214
Closed

tools/tracer: fails to build with libc++ #2209

jbeich opened this issue Jul 10, 2020 · 0 comments · Fixed by #2214
Assignees

Comments

@jbeich
Copy link
Contributor

jbeich commented Jul 10, 2020

Steps to reproduce

$ export CC=clang CXX=clang++ CXXFLAGS="$CXXFLAGS -stdlib=libc++" LDFLAGS="$LDFLAGS -fuse-ld=bfd"
$ cmake -DBUILD_TOOLS=ON -B /tmp/MediaSDK_build -G Ninja
$ cmake --build /tmp/MediaSDK_build

Clang 10

tools/tracer/dumps/dump.h:175:42: error: dynamic_cast from rvalue to reference type 'std::ostringstream &' (aka 'basic_ostringstream<char> &')
        str += "* " + structName + "=" + ToHexFormatString(_struct) + "\n";
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.h:81:37: note: expanded from macro 'ToHexFormatString'
    #define ToHexFormatString( x ) (dynamic_cast< std::ostringstream & >( ( std::ostringstream() << std::hex << pVoidToHexString((void*)x) ) ).str() )
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.h:182:42: error: dynamic_cast from rvalue to reference type 'std::ostringstream &' (aka 'basic_ostringstream<char> &')
        str += "* " + structName + "=" + ToHexFormatString(_struct) + "\n";
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.h:81:37: note: expanded from macro 'ToHexFormatString'
    #define ToHexFormatString( x ) (dynamic_cast< std::ostringstream & >( ( std::ostringstream() << std::hex << pVoidToHexString((void*)x) ) ).str() )
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.h:200:56: error: dynamic_cast from rvalue to reference type 'std::ostringstream &' (aka 'basic_ostringstream<char> &')
                    name = structName + ".ExtParam[" + ToString(i) + "]";
                                                       ^~~~~~~~~~~
tools/tracer/dumps/dump.h:70:28: note: expanded from macro 'ToString'
    #define ToString( x )  dynamic_cast< std::ostringstream & >( \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.h:490:67: error: dynamic_cast from rvalue to reference type 'std::ostringstream &' (aka 'basic_ostringstream<char> &')
                    str += "WARNING: Can't read from ExtParam[" + ToString(i) + "]!\n";
                                                                  ^~~~~~~~~~~
tools/tracer/dumps/dump.h:70:28: note: expanded from macro 'ToString'
    #define ToString( x )  dynamic_cast< std::ostringstream & >( \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.cpp:370:23: error: dynamic_cast from rvalue to reference type 'std::ostringstream &' (aka 'basic_ostringstream<char> &')
        name += "(" + ToString(io) + ")";
                      ^~~~~~~~~~~~
tools/tracer/dumps/dump.h:70:28: note: expanded from macro 'ToString'
    #define ToString( x )  dynamic_cast< std::ostringstream & >( \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 errors generated.

GCC 10

In file included from tools/tracer/dumps/dump.cpp:31:
tools/tracer/dumps/dump.h: In member function 'std::__1::string DumpContext::dump(std::__1::string, const void*)':
tools/tracer/dumps/dump.h:81:37: error: invalid 'static_cast' from type 'std::__1::basic_ostringstream<char>' to type 'std::__1::ostringstream&' {aka 'std::__1::basic_ostringstream<char>&'}
   81 |     #define ToHexFormatString( x ) (dynamic_cast< std::ostringstream & >( ( std::ostringstream() << std::hex << pVoidToHexString((void*)x) ) ).str() )
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.h:182:42: note: in expansion of macro 'ToHexFormatString'
  182 |         str += "* " + structName + "=" + ToHexFormatString(_struct) + "\n";
      |                                          ^~~~~~~~~~~~~~~~~
In file included from tools/tracer/dumps/dump.cpp:31:
tools/tracer/dumps/dump.cpp: In function 'std::__1::string GetIOPattern(mfxU32)':
tools/tracer/dumps/dump.h:70:28: error: invalid 'static_cast' from type 'std::__1::basic_ostringstream<char>' to type 'std::__1::ostringstream&' {aka 'std::__1::basic_ostringstream<char>&'}
   70 |     #define ToString( x )  dynamic_cast< std::ostringstream & >( \
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   71 |         ( std::ostringstream() << std::dec << x ) ).str()
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/tracer/dumps/dump.cpp:370:23: note: in expansion of macro 'ToString'
  370 |         name += "(" + ToString(io) + ")";
      |                       ^~~~~~~~
aobolensk added a commit to aobolensk/MediaSDK that referenced this issue Jul 14, 2020
aobolensk added a commit to aobolensk/MediaSDK that referenced this issue Jul 14, 2020
dmitryermilov pushed a commit that referenced this issue Jul 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants