Clean-up: coverity warns of uncaught exception during logging
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Jan 2023 17:01:53 +0000 (12:01 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Jan 2023 19:13:13 +0000 (14:13 -0500)
Coverity reports:

  1502349 Uncaught exception If the exception is ever thrown, the
  program will crash.

  In lttng::​file_descriptor::​~file_descriptor(): A C++ exception is
  thrown but never caught (CWE-248)

and

  1502348 Uncaught exception If the exception is ever thrown, the
  program will crash.

  In main: A C++ exception is thrown but never caught (CWE-248)

Both have the same cause: libfmt should not be used in "final" catch
blocks before returning to non exception-safe code in order to contain
all exceptions.

As we add custom formaters, it could be interesting to revisit this and
provide a noexcept wrapper for fmt::format. For the moment not much is
lost (beyond format string type safety) from using the existing logging
macros directly.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia70505517678ae182f6479feeb264c9402aa1381


No differences found
This page took 0.024607 seconds and 4 git commands to generate.