Archived

This forum has been archived. Please start a new discussion on GitHub.

DataStorm compilation issue on MacOS - NodeI.cpp:476:24: error: loop variable 's' of type ... create

Hello and best wishes for the new year.

Observing following compilation error on MacOSX on DataStorm 0.2 cloned from github.
This is with Ice-3.7.4. binary distribution installed on MacOS Big Sur 11.1
Changing to "for(const auto &s : _subscribers)" 'avoids' the compilation error as stipulated by the recommendation given below.

Am I missing something about macosx specific config or version fetched from github?

datastorm % make
making all in cpp
Compiling [macosx-shared] src/DataStorm/NodeI.cpp
src/DataStorm/NodeI.cpp:476:24: error: loop variable 's' of type 'const std::__1::pair >' creates a copy from type 'const
std::__1::pair >'
[-Werror,-Wrange-loop-analysis]
for(const auto s : _subscribers)
^
src/DataStorm/NodeI.cpp:476:13: note: use reference type 'const std::__1::pair > &' to prevent copying
for(const auto s : _subscribers)
^~~~~~
&
src/DataStorm/NodeI.cpp:487:24: error: loop variable 's' of type 'const std::__1::pair >' creates a copy from type 'const
std::__1::pair >'
[-Werror,-Wrange-loop-analysis]
for(const auto s : _publishers)
^
src/DataStorm/NodeI.cpp:487:13: note: use reference type 'const std::__1::pair > &' to prevent copying
for(const auto s : _publishers)
^~~~~~
&
2 errors generated.
make[1]: *** [src/DataStorm/build/macosx/shared/pic/NodeI.o] Error 1

Tagged:

Comments

  • xdm
    xdm La Coruña, Spain

    Hi,

    Thanks for reporting the issue, we have pushed the fix to the datastorm repository.

    Cheers,
    Jose

  • Many thanks - "working" (fast action - like in old times :-) ).

    just a small copy/paste issue I think:
    In demos/cpp/make/Make.rules
    DATASTORM_HOME ?= /opt/DataStorm-3.7.0
    should be changed to
    DATASTORM_HOME ?= /opt/DataStorm-0.2.0
    for bare consistency with the version number

    sent pull request

    Cheers
    Manfred