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

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

Open
middlenebel opened this issue Feb 1, 2024 · 0 comments

Comments

@middlenebel
Copy link

middlenebel commented Feb 1, 2024

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.

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

No branches or pull requests

1 participant