Fix build failure with GCC 13.2

After a system update, this stopped building:

 velia/src/system/Authentication.cpp: In function ‘auto velia::system::impl::file_open(const char*, const char*)’:
 velia/src/system/Authentication.cpp:58:65: error: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Werror=ignored-attributes]
    58 |     auto res = std::unique_ptr<std::FILE, decltype(&std::fclose)>(std::fopen(filename, mode), std::fclose);
       |                                                                 ^

The root cause is that fclose's argument has
__attribute__((nonnull(1))), and that attribute triggers that warning.

It turns out that this pattern is actually not strictly speaking correct
because one is not allowed to take the address of a standard function
like this. Also, declaring the unique_ptr with a function-pointer
destructor is a wee bit less effective because this type would offer
runtime customization of its behavior, whereas we do not really need
to consult this function pointer at runtime.

Fortunately, as of C++20 it's OK to use a decltype(lambda) as the
second template type to unique_ptr (and then it's OK to rely on its
implicit "construction" for the actual destructor), so the fix is pretty
short. Yay!

Change-Id: Ibd0397ad3446c0fe95de297f36d11637eb74d96c
Link: https://stackoverflow.com/questions/76867698/what-does-ignoring-attributes-on-template-argument-mean-in-this-context
Link: https://stackoverflow.com/a/76867913/2245623
1 file changed
tree: 6dc517d7a317d0b5cc246f46f267e46c2655943c
  1. .clang-format
  2. .gitmodules
  3. .zuul.yaml
  4. CMakeLists.txt
  5. Doxyfile.in
  6. LICENSE
  7. LICENSE.md
  8. README.md
  9. ci/
  10. cmake/
  11. docs/
  12. src/
  13. tests/
  14. yang/
README.md

YANG System management for embedded devices running Linux

Together with sysrepo, this software provides "general system management" of embedded devices. The target platform is anything that runs Linux with systemd. This runs in production on CzechLight SDN DWDM devices.

Health tracking

This component tracks the overal health state of the system, including various sensors, or the state of systemd units. As an operator-friendly LED at the front panel of the appliance shows the aggregated health state.

System management

Firmware can be updated via RAUC, and various aspects of the system's configuration can be adjusted. This includes a firewall, basic network settings, and authentication management.

Supported YANG models

For a full list, consult the yang/ directory in this repository.

Installation

For building, one needs:

The build process uses CMake. A quick-and-dirty build with no fancy options can be as simple as mkdir build && cd build && cmake .. && make && make install.