public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: Jonathan Wakely via Gcc-patches <gcc-patches@gcc.gnu.org>,
	libstdc++@gcc.gnu.org
Subject: Re: [committed] libstdc++: Do not include <system_error> in concurrency headers
Date: Fri, 13 Jan 2023 16:39:28 +0000	[thread overview]
Message-ID: <CACb0b4nZdOEUugsbXNEg_b==h3xaK_wB=zoaMGEAN7JQtKrvKA@mail.gmail.com> (raw)
In-Reply-To: <yddy1q6a2vk.fsf@CeBiTec.Uni-Bielefeld.DE>

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Fri, 13 Jan 2023 at 15:08, Rainer Orth wrote:
>
> Hi Jonathan,
>
> > The <condition_variable>, <mutex>, and <shared_mutex> headers use
> > std::errc constants, but don't use std::system_error itself. They only
> > use the __throw_system_error(int) function, which is defined in
> > <bits/functexcept.h>.
> >
> > By including the header for the errc constants instead of the whole of
> > <system_error> we avoid depending on the whole std::string definition.
>
> it seems this patch broke many tests on Solaris, e.g.
>
> FAIL: 29_atomics/atomic/requirements/types_neg.cc (test for excess errors)
> Excess errors:
> /var/gcc/regression/master/11.4-gcc/build/i386-pc-solaris2.11/libstdc++-v3/include/bits/std_mutex.h:157: error: 'EBUSY' was not declared in this scope
>

Oops, testing this patch now.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 744 bytes --]

commit 58e6fe334e55f56eeb0211c10697be4d4a8c52b6
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jan 13 16:37:57 2023

    libstdc++: Add <errno.h> to <bits/std_mutex.h>
    
    This needs to be included explicitly now that we don't include all of
    <system_error> here.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/std_mutex.h: Include <errno.h>.

diff --git a/libstdc++-v3/include/bits/std_mutex.h b/libstdc++-v3/include/bits/std_mutex.h
index bc515358d23..f74ddc4123a 100644
--- a/libstdc++-v3/include/bits/std_mutex.h
+++ b/libstdc++-v3/include/bits/std_mutex.h
@@ -36,6 +36,7 @@
 # include <bits/c++0x_warning.h>
 #else
 
+#include <errno.h> // EBUSY
 #include <bits/functexcept.h>
 #include <bits/gthr.h>
 

  reply	other threads:[~2023-01-13 16:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13  0:15 Jonathan Wakely
2023-01-13 15:08 ` Rainer Orth
2023-01-13 16:39   ` Jonathan Wakely [this message]
2023-01-13 17:38     ` Jonathan Wakely
2023-01-16 13:21       ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4nZdOEUugsbXNEg_b==h3xaK_wB=zoaMGEAN7JQtKrvKA@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).