From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01197387544E; Wed, 12 Jun 2024 10:56:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01197387544E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718189803; bh=SeYkk5lh931SjDqvcr7ULwLtgvXFUjLODGruAmN/3a8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yMu0P9Mp9mwM4Rcp39QLEKxKRCGRVBN9cjn8QPhKL2j+SXCiitqYEtWCtNeXnLnk2 HEH9zs7r04TZo9GlpJewcbeNotiPrBiXf7VGbQ3RD8UJTgSAaBkzslLFKdn6aEqcT+ prF3j1KpA9VvVXKfWd7UVq0RY6R5IGkMyjSYVguY= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113376] Confusing notes when using C++17 parallel algorithms Date: Wed, 12 Jun 2024 10:56:42 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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=3D113376 --- Comment #6 from Jonathan Wakely --- (In reply to Pilar Latiesa from comment #3) > It seems that what is missing is a corresponding change in the macro > definition logic. It should have been changed to: >=20 > // Check the user-defined macro for warnings > #if defined(PSTL_USAGE_WARNINGS) > # define _PSTL_USAGE_WARNINGS > #endif >=20 > See > https://github.com/llvm/llvm-project/blob/ > 5ccf19ded09f68bef43275c81c20b0e65f7c0b75/pstl/include/pstl/internal/ > pstl_config.h#L26 The upstream change breaks the previous API though. It looks like users were able to define PSTL_USAGE_WARNINGS=3D0 or PSTL_USAGE_WARNINGS=3D1 to request warnings to be off or on, respectively. = But the LLVM change means that it only matters whether it's defined or not. This seems to have been a misguided change to make sure *all* macros are used wi= th #ifdef not #if. But that breaks the intended use for some of them. So I think we should either revert the change later in the file which checks _PSTL_USAGE_WARNINGS, or we should take the user-facing macro's value into account when deciding whether to define it: // Check the user-defined macro for warnings #if defined(PSTL_USAGE_WARNINGS) && PSTL_USAGE_WARNINGS !=3D 0 # define _PSTL_USAGE_WARNINGS #endif=