Skip to content

gcc-14: warning: ‘<anonymous>’ may be used uninitialized #315

@kakra

Description

@kakra

Gentoo emits the following warning when building the package:

In member function ‘__ct ’,
    inlined from ‘__ct ’ at bees-trace.cc:47:2,
    inlined from ‘operator()’ at bees-roots.cc:1743:4,
    inlined from ‘__invoke_impl’ at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:61:36,
    inlined from ‘__invoke_r’ at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:150:33,
    inlined from ‘_M_invoke’ at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:290:30:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:391:17: warning: ‘<anonymous>’ may be used uninitialized [-Wmaybe-uninitialized]
  391 |             __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
      |                 ^
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h: In function ‘_M_invoke’:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:267:7: note: by argument 2 of type ‘const union _Any_data & {ref-all}’ to ‘_M_manager’ declared here
  267 |       _M_manager(_Any_data& __dest, const _Any_data& __source,
      |       ^
bees-roots.cc:1743:25: note: ‘<anonymous>’ declared here
 1743 |                         BEESTRACE("calling transid_max_nocache");
      |                         ^

This is probably another instance of newer gcc versions showing spurious warnings but I just wanted to report that in case it is something that should be fixed.

Thanks.

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