Skip to content

Warning from flockfile #4060

@glebm

Description

@glebm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions