From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C73F3858C00; Sun, 6 Nov 2022 21:39:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C73F3858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667770785; bh=cKnq9Ggk3LbUxxSDla5vkVTlBp69HsQKXzOdLMIrI2o=; h=From:To:Subject:Date:From; b=ArkTCN0HQ3KzTwzu3NoF9QqRlDbqcZd9tbBj8V2whf/uO/d2GwWQ0xdRXEX+RLmr5 Hc0Lty1QHAklB6SD5o8FMtsd89c5G9RFDe05dHPi9MgytZI8G+NxPhea8ixVZgXQI4 UBzRPyRhtWE4iF1YnyzX2By4xw9v1+Kpzgs97ykE= From: "i at maskray dot me" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107543] New: c-family/c-cppbuiltin.cc: Undefine __GNUC_STDC_INLINE__ in C++ mode? Date: Sun, 06 Nov 2022 21:39:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D107543 Bug ID: 107543 Summary: c-family/c-cppbuiltin.cc: Undefine __GNUC_STDC_INLINE__ in C++ mode? Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- -fgnu89-inline / C99 / C++ inline modes are all different. For C++, perhaps neither=20 __GNUC_STDC_INLINE__ nor __GNUC_GNUC_INLINE__ should be defined. % g++ -dM -E -xc++ /dev/null | grep __GNUC_STDC_INLINE__ #define __GNUC_STDC_INLINE__ 1 gcc/doc/cpp.texi does not talk about C++ @item __GNUC_STDC_INLINE__ GCC defines this macro if functions declared @code{inline} will be handled according to the ISO C99 or later standards. Object files will con= tain externally visible definitions of all functions declared @code{extern inline}. They will not contain definitions of any functions declared @code{inline} without @code{extern}. If this macro is defined, GCC supports the @code{gnu_inline} function attribute as a way to always get the gnu90 behavior. Side note: there is "warning: command-line option =E2=80=98-fgnu89-inline= =E2=80=99 is valid for C/ObjC but not for C++" but __attribute__((gnu_inline)) is usable in C++ m= ode and has strange codegen behaviors.=