From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 883F23882AC9; Tue, 18 Jun 2024 18:05:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 883F23882AC9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 883F23882AC9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718733903; cv=none; b=opoJTipAX0+VP9LKONgftbUUC7bERWETDVfrPAQMHcIz4mA6Hql13Ut9yNmjOE13AtYDq1LC7RNZLPcKIG0xcRxCaBbbRx5QTqe2zxK1i9V6W9aF3pyzYqYauy2iQL5DaTftH3hwzaSimqbcTmpWHUUxp3I3tL6gQL3klNYMDmI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718733903; c=relaxed/simple; bh=qA0Ije6ZyLQAWNDkcSIDi33ErHtrKX2BaqqVPGMFWd8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rmUdzJMjU7ifVI7MHakA/zv3nE0AGoZa/sWNZ3c/rQpNHsYaWXMWUEAx43ueHR8j0jEsl8mFHWfNDYU9pRCw3QsZYgJ8m/5S8q9D52rEgPlO3iaKKEuUlxJQXGJTW6XjYB8qbAt6DfLWbG5TdddwOJMJnM8+uEXMWadu6QLK8zs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a6f09eaf420so687331466b.3; Tue, 18 Jun 2024 11:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718733900; x=1719338700; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=Wm07qH4FMsdQdyzOeYzD+P8+88rf0hxWLcojrUuck2Y=; b=c46S5UBKaVKNYH0fNh5NRYtgOD0/quAWQB7jJSalm0oPhZM8LThVsxEVs23vyWha+2 X7Za/KDn2W759iXnQsoInK6UcgPifK4JTgS4iQhduQX3vwz1nmQmjEpD1GNf7O3O1e16 NMnKdA+FLjFV7KmFq/6HMjP4MULlNcmEoN6ZfVJEyMsIpS+GvtJ97R84rNzDDEt4U5BV Ea07ZM6bDelnoDjtCCofyAefWFIj6nQp9JO8aMr/vTCRnkjEq330//waxx+Bftc0Mwza YZlS3+y2lKzt/Vu6I5UWYG4eIiqLN2DepKvRwuGGL7NtLAxBvLflHF8b/hskIs+sT2wK R05g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718733900; x=1719338700; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wm07qH4FMsdQdyzOeYzD+P8+88rf0hxWLcojrUuck2Y=; b=lEdzXerwbIEVjg/6QiQ3fAQrpADfOdhEcIoGi4PZH7Scr7FnhWwZToY7IMA6bQN5DN GW4ZXbv33wVms5D8nA/T+fSmcvWSM2ApguPwPrx9HzZChtgBlSmKWRbEz2nlhKc8rvFY Y5GEdpgFTmU8CD8F7RoJRmoQ7b+Fv5tuE+BZ6PUmhdpUwLdZvwNkZ7OQFP9s/w0K6erg g8CKp/kOWlI1cTDFKYXX9PNICKNU+YioZ23Xw5EmD69VNVINVRmFCv+ryNCmaHovWhUW h15A134/W823+DYzwW04ZR3HGNlhYrDdc9gB29WGXj+iJeDNHf07nIj5E+4w3k/iRZxp YpzQ== X-Forwarded-Encrypted: i=1; AJvYcCVKgmHtOYN2ndMFdfK0ng9Fl244oJTCWIZIRw9Iiu9hBJtqH31ihscD37qheHY5qlWqUF4H0465qT7Sr40DICZ5TG3FkQb6e00nxNPbUtQyVr24vqqx5/7hneGmPo2S X-Gm-Message-State: AOJu0YynQpB2sk7st9sE+OTqvXYA9ctH0Qb8ShwuEQn1duZlTmjWALSA /y4a/fyMqKOzN1sSJwZ5Pvpc79eHEabqRZfqkIWswbr7JQK/xNv4 X-Google-Smtp-Source: AGHT+IGy7x/mjBe6V8MJwk+DVEvQ/NdyEI+HoN7i+giC934Fu0a501MzUDTKAcY8iY5wGCN+apyf2g== X-Received: by 2002:a17:906:99c6:b0:a59:b590:5d71 with SMTP id a640c23a62f3a-a6fab061a18mr18403066b.0.1718733899710; Tue, 18 Jun 2024 11:04:59 -0700 (PDT) Received: from [192.168.178.69] (94-33-133-N4.customer.vsm.sh. [170.133.33.94]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56db6738sm633118466b.53.2024.06.18.11.04.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jun 2024 11:04:59 -0700 (PDT) Message-ID: Date: Tue, 18 Jun 2024 20:04:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] libstdc++: Handle extended alignment in std::get_temporary_buffer [PR105258] To: Jonathan Wakely , libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org References: <20240601102927.878453-1-jwakely@redhat.com> <20240601112310.893276-1-jwakely@redhat.com> Content-Language: en-US From: Stephan Bergmann In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 6/3/24 22:22, Jonathan Wakely wrote: > Pushed to trunk now. Just a heads-up that this started to cause Clang (at least 18/19) to emit a -Wdeprecated-declarations now, > $ cat test.cc > #include > void f(int * p1, int * p2) { std::stable_sort(p1, p2); } > $ clang++ --gcc-install-dir=/home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0 -fsyntax-only test.cc > In file included from test.cc:1: > In file included from /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/algorithm:61: > In file included from /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_algo.h:69: > /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_tempbuf.h:207:11: warning: 'get_temporary_buffer' is deprecated [-Wdeprecated-declarations] > 207 | std::get_temporary_buffer(__original_len)); > | ^ > /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_tempbuf.h:323:40: note: in instantiation of member function 'std::_Temporary_buffer<__gnu_cxx::__normal_iterator>, int>::_Impl::_Impl' requested here > 323 | : _M_original_len(__original_len), _M_impl(__original_len) > | ^ > /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_algo.h:4948:15: note: in instantiation of member function 'std::_Temporary_buffer<__gnu_cxx::__normal_iterator>, int>::_Temporary_buffer' requested here > 4948 | _TmpBuf __buf(__first, (__last - __first + 1) / 2); > | ^ > /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_algo.h:4993:23: note: in instantiation of function template specialization 'std::__stable_sort<__gnu_cxx::__normal_iterator>, __gnu_cxx::__ops::_Iter_less_iter>' requested here > 4993 | _GLIBCXX_STD_A::__stable_sort(__first, __last, > | ^ > test.cc:3:37: note: in instantiation of function template specialization 'std::stable_sort<__gnu_cxx::__normal_iterator>>' requested here > 3 | void f(std::vector & v) { std::stable_sort(v.begin(), v.end()); } > | ^ > /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/bits/stl_tempbuf.h:141:5: note: 'get_temporary_buffer' has been explicitly marked deprecated here > 141 | _GLIBCXX17_DEPRECATED > | ^ > /home/sberg/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/15.0.0/../../../../include/c++/15.0.0/x86_64-pc-linux-gnu/bits/c++config.h:123:34: note: expanded from macro '_GLIBCXX17_DEPRECATED' > 123 | # define _GLIBCXX17_DEPRECATED [[__deprecated__]] > | ^ > 1 warning generated. which could be silenced with > --- a/libstdc++-v3/include/bits/stl_tempbuf.h > +++ b/libstdc++-v3/include/bits/stl_tempbuf.h > @@ -203,8 +203,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > explicit > _Impl(ptrdiff_t __original_len) > { > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > pair __p( > std::get_temporary_buffer(__original_len)); > +#pragma GCC diagnostic pop > _M_len = __p.second; > _M_buffer = __p.first; > } (There already is another such pragma diagnostic ignored a bit further down in that file, so I assume that's the way to go there?)