Skip to content

warning: object backing the pointer will be destroyed at the end of the full-expression #313

@middlenebel

Description

@middlenebel

Hello, I found this warning compiling into a Dockerfile:

[ 75%] Building CXX object src/CMakeFiles/cppkafka.dir/producer.cpp.o
/app/cppkafka/src/producer.cpp:154:54: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
RD_KAFKA_V_TOPIC(message.get_topic().data()),
^~~~~~~~~~~~~~~~~~~
/usr/include/librdkafka/rdkafka.h:1152:60: note: expanded from macro 'RD_KAFKA_V_TOPIC'
_LRK_TYPECHECK(RD_KAFKA_VTYPE_TOPIC, const char *, topic),
^~~~~
/usr/include/librdkafka/rdkafka.h:115:47: note: expanded from macro '_LRK_TYPECHECK'
TYPE __t RD_UNUSED = (ARG);
^~~
1 warning generated.

Edit:

It was because of the Catch2 submodule, because I did a recursive update. With the current version in cppkafka it does not give that warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions