Bug 46105 - apt: ошибка сборки с GCC 13
Summary: apt: ошибка сборки с GCC 13
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: apt (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks: 45802
  Show dependency tree
 
Reported: 2023-05-11 04:12 MSK by Alexey Sheplyakov
Modified: 2023-06-08 01:45 MSK (History)
9 users (show)

See Also:


Attachments
исправление (1.65 KB, patch)
2023-05-11 04:14 MSK, Alexey Sheplyakov
no flags Details | Diff
исправление, часть 2 (2.47 KB, patch)
2023-05-11 04:37 MSK, Alexey Sheplyakov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Sheplyakov 2023-05-11 04:12:10 MSK
contrib/mmap.cc:80:20: error: 'SIZE_MAX' was not declared in this scope
   80 |    if (EndOfFile > SIZE_MAX)
      |                    ^~~~~~~~
contrib/mmap.cc:38:8: note: 'SIZE_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   37 | #include <cassert>
  +++ |+#include <cstdint>
   38 |                                                                         /*}}}*/
contrib/mmap.cc:82:40: error: 'uintmax_t' does not name a type
   82 |                            static_cast<uintmax_t>(EndOfFile));
      |                                        ^~~~~~~~~
contrib/mmap.cc: In member function 'std::optional<long unsigned int> DynamicMMap::WriteString(const char*, size_t)':
contrib/mmap.cc:363:15: error: 'SIZE_MAX' was not declared in this scope
  363 |    if (Len == SIZE_MAX)
      |               ^~~~~~~~
contrib/mmap.cc:363:15: note: 'SIZE_MAX' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
make[1]: *** [Makefile:775: contrib/mmap.lo] Error 1
Comment 1 Alexey Sheplyakov 2023-05-11 04:14:06 MSK
Created attachment 13149 [details]
исправление
Comment 2 Alexey Sheplyakov 2023-05-11 04:37:36 MSK
Created attachment 13151 [details]
исправление, часть 2
Comment 3 Alexey Sheplyakov 2023-05-11 04:38:16 MSK
   http.cc:1014:18: error: ignoring return value of 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>;>
     1014 |    FailFile.c_str();   // Make sure we dont do a malloc in the signal handler
          |    ~~~~~~~~~~~~~~^~
    In file included from /usr/include/c++/13/string:54,
                     from ../include/apt-pkg/fileutl.h:23,
                     from http.cc:29:
    /usr/include/c++/13/bits/basic_string.h:2594:7: note: declared here
     2594 |       c_str() const _GLIBCXX_NOEXCEPT
          |       ^~~~~
    cc1plus: all warnings being treated as errors
    make[1]: *** [Makefile:622: http.o] Error 1
    
    Similarly in ftp.cc and rsh.cc
Comment 4 Ivan Zakharyaschev 2023-05-16 17:48:31 MSK
(Ответ для Alexey Sheplyakov на комментарий #3)
>    http.cc:1014:18: error: ignoring return value of 'const _CharT*
> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with
> _CharT = char; _Traits = std::char_traits<char>;>
>      1014 |    FailFile.c_str();   // Make sure we dont do a malloc in the
> signal handler
>           |    ~~~~~~~~~~~~~~^~
>     In file included from /usr/include/c++/13/string:54,
>                      from ../include/apt-pkg/fileutl.h:23,
>                      from http.cc:29:
>     /usr/include/c++/13/bits/basic_string.h:2594:7: note: declared here
>      2594 |       c_str() const _GLIBCXX_NOEXCEPT
>           |       ^~~~~
>     cc1plus: all warnings being treated as errors
>     make[1]: *** [Makefile:622: http.o] Error 1
>     
>     Similarly in ftp.cc and rsh.cc

Спасибо за патч, включу его в следующий релиз, чтобы адаптироваться к требованиям gcc13. Правда, я там переписал сразу со static_cast:

static_cast<void>(FailFile.c_str());   // Make sure we dont do a malloc in the signal handler
Comment 5 Ivan Zakharyaschev 2023-05-17 04:14:53 MSK
(Ответ для Alexey Sheplyakov на комментарий #0)
> contrib/mmap.cc:80:20: error: 'SIZE_MAX' was not declared in this scope
>    80 |    if (EndOfFile > SIZE_MAX)
>       |                    ^~~~~~~~
> contrib/mmap.cc:38:8: note: 'SIZE_MAX' is defined in header '<cstdint>'; did
> you forget to '#include <cstdint>'?
>    37 | #include <cassert>
>   +++ |+#include <cstdint>
>    38 |                                                                     
> /*}}}*/
> contrib/mmap.cc:82:40: error: 'uintmax_t' does not name a type
>    82 |                            static_cast<uintmax_t>(EndOfFile));
>       |                                        ^~~~~~~~~
> contrib/mmap.cc: In member function 'std::optional<long unsigned int>
> DynamicMMap::WriteString(const char*, size_t)':
> contrib/mmap.cc:363:15: error: 'SIZE_MAX' was not declared in this scope
>   363 |    if (Len == SIZE_MAX)
>       |               ^~~~~~~~
> contrib/mmap.cc:363:15: note: 'SIZE_MAX' is defined in header '<cstdint>';
> did you forget to '#include <cstdint>'?
> make[1]: *** [Makefile:775: contrib/mmap.lo] Error 1

Спасибо, это я тоже учёл приложенным патчем, и в дальнейших изменениях постарался подобные места отследить.

Новый тег, который я собираю -- 0.5.15lorg2-alt84 в задании 320624 -- со всякими новыми изменениями, но я их с gcc13 не проверял, потому что у меня (в Сизифе) нет gcc13. Там может что-то ещё вылезти.
Comment 6 Repository Robot 2023-06-08 01:45:32 MSK
apt-0.5.15lorg2-alt84 -> sisyphus:

 Fri Jun 02 2023 Ivan Zakharyaschev <imz@altlinux> 0.5.15lorg2-alt84
 - Fixed the display of descriptions in aptitude and packagekit (by making
   the format closer to Debian's):
   + Fixed the display of the first line, which was not shown in packagekit.
   + Fixed the regression (from 0.5.15lorg2-alt72) in the display of
     all but the first lines (in aptitude and packagekit). (ALT#40826)
   + This has also made packagekit show translated descriptions. (ALT#46251)
   + As a result, there is a cosmetic regression in synaptic: extra blanks.
 - Increased the buf for reading to 32k for effectiveness in methods:
   gzip (and other compression types), rsh, ftp.
 - Avoid compilation errors with GCC 13 (thx Alexey Sheplyakov). (ALT#46105)