Skip to content

Compilation Error due to danling-reference warning with -Werror #7749

@jparsert

Description

@jparsert

Pulling the develop branch and change into cbmc directory and executing the following commands:

git submodule update --init
cmake -S . -Bbuild
cd build
make

I get the following errors:

.../cbmc/src/goto-symex/goto_symex.cpp:350:18: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 350 | const symbolt &return_symbol = get_fresh_aux_symbol( ...

and

.../cbmc/src/solvers/smt2/smt2_conv.cpp:998:37: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 998 | for(auto ch : id2string(identifier))
I suspect these are not the only errors if I did not abort the compilation.

After adding "-Wno-dangling-reference" I got the following errors:
.../src/util/cmdline.h:75:16: error: ‘virtual bool cmdlinet::parse(int, const char**, const char*)’ was hidden [-Werror=overloaded-virtual=] 75 | virtual bool parse(int argc, const char **argv, const char *optstring);

Working with linux6.3-4-1 Manjaro and GCC 13.1.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions