ALT Linux Bugzilla
– Attachment 13151 Details for
Bug 46105
apt: ошибка сборки с GCC 13
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
исправление, часть 2
0002-methods-avoid-compilation-error-with-GCC-13.patch (text/plain), 2.47 KB, created by
Alexey Sheplyakov
on 2023-05-11 04:37:36 MSK
(
hide
)
Description:
исправление, часть 2
Filename:
MIME Type:
Creator:
Alexey Sheplyakov
Created:
2023-05-11 04:37:36 MSK
Size:
2.47 KB
patch
obsolete
>From f6d7309c6778222a450dfdf1c7c26dde4ff91872 Mon Sep 17 00:00:00 2001 >From: Alexey Sheplyakov <asheplyakov@basealt.ru> >Date: Thu, 11 May 2023 05:26:45 +0400 >Subject: [PATCH] methods: avoid compilation error with GCC 13 > >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>; _Alloc = std::allocator<char>]', declared with attribute 'nodiscard' [-Werror=unused-result] > 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 >--- > methods/ftp.cc | 2 +- > methods/http.cc | 2 +- > methods/rsh.cc | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/methods/ftp.cc b/methods/ftp.cc >index d2508cd..dd1f854 100644 >--- a/methods/ftp.cc >+++ b/methods/ftp.cc >@@ -1048,7 +1048,7 @@ bool FtpMethod::Fetch(FetchItem *Itm) > URIStart(Res); > > FailFile = Itm->DestFile; >- FailFile.c_str(); // Make sure we dont do a malloc in the signal handler >+ (void)FailFile.c_str(); // Make sure we dont do a malloc in the signal handler > FailFd = Fd.Fd(); > > bool Missing; >diff --git a/methods/http.cc b/methods/http.cc >index 32ab5a6..ea2be71 100644 >--- a/methods/http.cc >+++ b/methods/http.cc >@@ -1011,7 +1011,7 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) > return 5; > > FailFile = Queue->DestFile; >- FailFile.c_str(); // Make sure we dont do a malloc in the signal handler >+ (void)FailFile.c_str(); // Make sure we dont do a malloc in the signal handler > FailFd = File->Fd(); > FailTime = Srv->Date; > >diff --git a/methods/rsh.cc b/methods/rsh.cc >index 685df42..de59ce2 100644 >--- a/methods/rsh.cc >+++ b/methods/rsh.cc >@@ -475,7 +475,7 @@ bool RSHMethod::Fetch(FetchItem *Itm) > URIStart(Res); > > FailFile = Itm->DestFile; >- FailFile.c_str(); // Make sure we dont do a malloc in the signal handler >+ (void)FailFile.c_str(); // Make sure we dont do a malloc in the signal handler > FailFd = Fd.Fd(); > > bool Missing; >-- >2.33.7 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46105
:
13149
| 13151