From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E3243858CDB; Mon, 9 Jan 2023 21:23:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E3243858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673299432; bh=ifve9zHwHaxosZjhUSixJGf1GQS9m6Y0CQ35szBUQnE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cKx2xTyiPle/W2x1/uyKymUYb+5nMSc6L89RCByCCzlqDQKJFGKIOf2azK7nYzfYz RHdaSxwtjLyHuKCyGKWmIFGgPc5NDkx5Q9PtFfxXmlYAEmUSO1CoYgdwLwEu3YRoy3 eJBpeEz0szuo9awO9OEnqrRKUtWahjBZGSAa+LZY= From: "ruilvo at ua dot pt" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108342] std::complex: ignoring packed attribute because of unpacked non-POD field Date: Mon, 09 Jan 2023 21:23:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: ruilvo at ua dot pt X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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=3D108342 --- Comment #10 from Rui Oliveira --- So my options are to create like a placeholder, say=20 ```c typedef struct __attribute__((__packed__)) // Packed isn't really necessary here I think? { float re, im; } ph_fcomplex_t ``` To silence the warning and get packing to work, and trust [complex.numbers.general] for a reinterpret_cast into std::complex I guess.=