From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EFB403836C06; Fri, 12 Mar 2021 18:29:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFB403836C06 From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug build/22395] ODR violations Date: Fri, 12 Mar 2021 18:29:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2021 18:29:47 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D22395 --- Comment #6 from Tom Tromey --- (In reply to Pedro Alves from comment #5) > (In reply to Tom Tromey from comment #3) > > I got bit debugging an ODR problem in gdb today. > > I'd accidentally given a struct a name that was already in use. > > This would be nice to fix. >=20 > Note that in C, it's valid to have different definitions of structures in > different translation units. If GDB isn't coping with that, then I'd say > it's a GDB bug. >=20 > (Not saying we shouldn't fix the ODR violation, of course.) What happened was that I accidentally introduced a violation into gdb. The code was working for a while, but then I added another field to the structure in question, and I was puzzled because vector.push_back was crashing. It took me a while to figure out why this could possibly be happening. I don't know if -Wodr would really catch this though. (In reply to Christian Biesinger from comment #4) > When using gold as the linker, could try --detect-odr-violations I tried this just now but it didn't report anything. That seems incorrect though. --=20 You are receiving this mail because: You are on the CC list for the bug.=