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 from flockfile #4060

Closed
glebm opened this issue Jul 8, 2024 · 2 comments
Closed

Warning from flockfile #4060

glebm opened this issue Jul 8, 2024 · 2 comments

Comments

@glebm
Copy link
Contributor

glebm commented Jul 8, 2024

Getting a compilation warning:

fmt/format-inl.h:1456:50: warning: argument 1 null where non-null expected [-Wnonnull]
 1456 | struct has_flockfile<F, void_t<decltype(flockfile(static_cast<F*>(nullptr)))>>
      |                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/cstdio:42,
                 from /usr/include/c++/13/ext/string_conversions.h:45,
                 from /usr/include/c++/13/bits/basic_string.h:4109,
                 from /usr/include/c++/13/string:54,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/locale:41,
                 from /home/gleb/devilutionX/build/_deps/libfmt-src/include/fmt/format-inl.h:19:
/usr/include/stdio.h:941:13: note: in a call to function ‘void flockfile(FILE*)’ declared ‘nonnull’
  941 | extern void flockfile (FILE *__stream) __THROW __nonnull ((1));

The warning is spurious since this is in decltype. Maybe this should be considered a bug in GCC actually.

@vitaut
Copy link
Contributor

vitaut commented Jul 8, 2024

This is a false positive because the call is in an unevaluated context. Please report to gcc.

@vitaut
Copy link
Contributor

vitaut commented Jul 8, 2024

In any case, the warning should be suppressed in 92227c7.

@vitaut vitaut closed this as completed Jul 8, 2024
mtremer pushed a commit to ipfire/ipfire-2.x that referenced this issue Aug 15, 2024
- Update from version 11.0.1 to 11.0.2
- Update of rootfile
- Changelog
    11.0.2
	- Fixed compatibility with non-POSIX systems
	  (fmtlib/fmt#4054,
	  fmtlib/fmt#4060).
	- Fixed performance regressions when using `std::back_insert_iterator` with
	  `fmt::format_to` (fmtlib/fmt#4070).
	- Fixed handling of `std::generator` and move-only iterators
	  (fmtlib/fmt#4053,
	  fmtlib/fmt#4057). Thanks @Arghnews.
	- Made `formatter<std::string_view>::parse` work with types convertible to
	  `std::string_view` (fmtlib/fmt#4036,
	  fmtlib/fmt#4055). Thanks @Arghnews.
	- Made `volatile void*` formattable
	  (fmtlib/fmt#4049,
	  fmtlib/fmt#4056). Thanks @Arghnews.
	- Made `Glib::ustring` not be confused with `std::string`
	  (fmtlib/fmt#4052).
	- Made `fmt::context` iterator compatible with STL algorithms that rely on
	  iterator category (fmtlib/fmt#4079).

Signed-off-by: Adolf Belka <[email protected]>
Signed-off-by: Michael Tremer <[email protected]>
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

2 participants