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

gcc-13/14 c++23 build errors #4150

Closed
phprus opened this issue Sep 3, 2024 · 2 comments · Fixed by #4151
Closed

gcc-13/14 c++23 build errors #4150

phprus opened this issue Sep 3, 2024 · 2 comments · Fixed by #4151

Comments

@phprus
Copy link
Contributor

phprus commented Sep 3, 2024

cmake (command from CI config):

cmake -DCMAKE_BUILD_TYPE=Release  -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_CXX_STANDARD=23 -DFMT_DOC=OFF \
        -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
        -DFMT_PEDANTIC=ON

error:

[  1%] Building CXX object test/gtest/CMakeFiles/gtest.dir/gmock-gtest-all.cc.o
[  2%] Building CXX object test/CMakeFiles/nolocale-test.dir/__/src/format.cc.o
[  3%] Building CXX object test/CMakeFiles/noexception-test.dir/__/src/format.cc.o
[  5%] Building CXX object CMakeFiles/fmt.dir/src/format.cc.o
[  6%] Linking CXX shared library libnolocale-test.so
[  6%] Built target nolocale-test
[  7%] Building CXX object test/CMakeFiles/noexception-test.dir/noexception-test.cc.o
In file included from /usr/include/stdio.h:43,
                 from /home/runner/work/fmt/fmt/include/fmt/base.h:17,
                 from /home/runner/work/fmt/fmt/include/fmt/format.h:41,
                 from /home/runner/work/fmt/fmt/include/fmt/format-inl.h:23,
                 from /home/runner/work/fmt/fmt/src/format.cc:8:
In function ‘int putc_unlocked(int, FILE*)’,
    inlined from ‘void fmt::v11::detail::glibc_file<F>::init_buffer() [with F = _IO_FILE]’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1515:18,
    inlined from ‘fmt::v11::detail::file_print_buffer<F, typename std::enable_if<fmt::v11::detail::has_flockfile<F>::value, void>::type>::file_print_buffer(F*) [with F = _IO_FILE]’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1665:22,
    inlined from ‘void fmt::v11::vprint(FILE*, string_view, format_args)’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1724:48:
/usr/include/x86_64-linux-gnu/bits/stdio.h:103:10: warning: null pointer dereference [-Wnull-dereference]
  103 |   return __putc_unlocked_body (__c, __stream);
      |          ^~~~~~~~~~~~~~~~~~~~
In function ‘int putc_unlocked(int, FILE*)’,
    inlined from ‘void fmt::v11::detail::glibc_file<F>::init_buffer() [with F = _IO_FILE]’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1515:18,
    inlined from ‘fmt::v11::detail::file_print_buffer<F, typename std::enable_if<fmt::v11::detail::has_flockfile<F>::value, void>::type>::file_print_buffer(F*) [with F = _IO_FILE]’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1665:22,
    inlined from ‘void fmt::v11::vprint(FILE*, string_view, format_args)’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1724:48,
    inlined from ‘void fmt::v11::vprint(string_view, format_args)’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1736:9:
/usr/include/x86_64-linux-gnu/bits/stdio.h:103:10: warning: null pointer dereference [-Wnull-dereference]
  103 |   return __putc_unlocked_body (__c, __stream);
      |          ^~~~~~~~~~~~~~~~~~~~
[  8%] Building CXX object CMakeFiles/fmt.dir/src/os.cc.o
In file included from /usr/include/stdio.h:43,
                 from /home/runner/work/fmt/fmt/include/fmt/base.h:17,
                 from /home/runner/work/fmt/fmt/include/fmt/format.h:41,
                 from /home/runner/work/fmt/fmt/include/fmt/format-inl.h:23,
                 from /home/runner/work/fmt/fmt/src/format.cc:8:
In function ‘int putc_unlocked(int, FILE*)’,
    inlined from ‘void fmt::v11::detail::glibc_file<F>::init_buffer() [with F = _IO_FILE]’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1515:18,
    inlined from ‘fmt::v11::detail::file_print_buffer<F, typename std::enable_if<fmt::v11::detail::has_flockfile<F>::value, void>::type>::file_print_buffer(F*) [with F = _IO_FILE]’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1665:22,
    inlined from ‘void fmt::v11::vprint(FILE*, string_view, format_args)’ at /home/runner/work/fmt/fmt/include/fmt/format-inl.h:1724:48:
/usr/include/x86_64-linux-gnu/bits/stdio.h:103:10: error: null pointer dereference [-Werror=null-dereference]
  103 |   return __putc_unlocked_body (__c, __stream);
      |          ^~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/fmt.dir/build.make:76: CMakeFiles/fmt.dir/src/format.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:163: CMakeFiles/fmt.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

@vitaut
Copy link
Contributor

vitaut commented Sep 4, 2024

Incorrectly autoclosed, reopening.

@vitaut
Copy link
Contributor

vitaut commented Sep 4, 2024

Suppressed the warning (false positive) in 6aaf7f4.

@vitaut vitaut closed this as completed Sep 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants