From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AA20F3858D3C; Wed, 1 Feb 2023 21:07:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA20F3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675285621; bh=o3gfTitwR2CdDYlWjFgbwHZiQC5laJWe4phu4i/qT9Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ifgE5SAU6zXk3mivziLoDVuV4CH3TYAHmr7MQwblldtkyrtWrSL3jOA6iXmVxQ7Tu Lo7jve5zAUJt8rbtW3n8I8lokd+oShW8n29zC9ArZXepyW3JvzvTW5OMPLcULE3KU9 7MSSedjnqYXO1fldQ4NafiRa5x6fVYMzHBTdCEQA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/104883] should define all std::errc enumerators Date: Wed, 01 Feb 2023 21:07:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104883 --- Comment #3 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:2d2e163d12f64a5e68f9e0381751ed9d5d6d3617 commit r13-5638-g2d2e163d12f64a5e68f9e0381751ed9d5d6d3617 Author: Jonathan Wakely Date: Tue Jan 31 22:16:31 2023 +0000 libstdc++: Fix build failures for avr The abr-libc does not define EOVERFLOW, which means that std::errc::value_too_large is not defined, and so cannot be compiled. Define value_too_large for avr with a value that does not clash with any that is defined in . This is a kluge to fix bootstrap for avr; it can be removed after PR libstdc++/104883 is resolved. The avr-libc fails to meet the C and POSIX requirements that each error macro has a distinct integral value, and is usable in #if directives. Add a special case for avr to system_error.cc so that only the valid errors are recognized. Also disable the errno checks in std::filesystem::remove_all that assume a meaningful value for errno. On avr-libc exists but does not define the POSIX functions needed by std::filesystem, so _GLIBCXX_HAVE_UNISTD_H is not sufficient to check for basic POSIX APIs. Check !defined __AVR__ as well as _GLIBCXX_HAVE_UNISTD_H before using those functions. This is a kluge and we should really have a specific macro that says the required functions are available. libstdc++-v3/ChangeLog: * config/os/generic/error_constants.h (errc::value_too_large) [__AVR__]: Define. * src/c++11/system_error.cc (system_category::default_error_condition) [__AVR__]: Only match recognize values equal to EDOM, ERANGE, ENOSYS and EINTR. * src/c++17/fs_ops.cc (fs::current_path) [__AVR__]: Do not check for ENOENT etc. in switch. (fs::remove_all) [__AVR__]: Likewise. * src/filesystem/ops-common.h [__AVR__]: Do not use POSIX open, close etc.=