[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7f953b7e2a9d30e0f22c30c5c4e10828018bc40c.camel@redhat.com>
Date: Mon, 05 Jan 2026 16:24:50 -0600
From: Crystal Wood <crwood@...hat.com>
To: Tomas Glozar <tglozar@...hat.com>, Costa Shulyupin
<costa.shul@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, Wander Lairson Costa
<wander@...hat.com>, Ivan Pravdin <ipravdin.official@...il.com>, John Kacur
<jkacur@...hat.com>, Tiezhu Yang <yangtiezhu@...ngson.cn>,
linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH v1 1/4] tools/rtla: Consolidate nr_cpus usage across all
tools
On Wed, 2025-12-17 at 10:06 +0100, Tomas Glozar wrote:
> út 16. 12. 2025 v 15:41 odesílatel Tomas Glozar <tglozar@...hat.com> napsal:
> > Since commit 2f3172f9dd58c ("tools/rtla: Consolidate code between
> > osnoise/timerlat and hist/top") that was merged into 6.18, common.h
> > includes timerlat_u.h. Your change thus causes a double include of
> > timerlat_u.h, leading to a build error:
> >
> > In file included from src/timerlat_u.c:20:
> > src/timerlat_u.h:6:8: error: redefinition of ‘struct timerlat_u_params’
> > 6 | struct timerlat_u_params {
> > | ^~~~~~~~~~~~~~~~~
> > In file included from src/common.h:5,
> > from src/timerlat_u.c:19:
> > src/timerlat_u.h:6:8: note: originally defined here
> > 6 | struct timerlat_u_params {
> > | ^~~~~~~~~~~~~~~~~
> >
> > Please rebase your patchset and fix this so that timerlat_u.h is only
> > included once.
> >
>
> Correction: the base of the patchset has nothing to do with this. It
> is the C standard, from C23 (default in GCC 15), redefinition of
> structs is allowed [1], so this error doesn't exist. In earlier
> standards, this is not allowed.
>
> [1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2863.pdf
Regardless of how permissive the language might be getting in this case,
we should have #pragma once on all of the headers to avoid this sort of
problem.
-Crystal
Powered by blists - more mailing lists