Re: [PATCH 01/13] libebl [1/13]: api for perf register handling, start with x86_64

2025-03-18 Thread Mark Wielaard
Hi Serhei,

On Mon, 2025-03-17 at 10:22 -0400, Serhei Makarov wrote:
> On Sun, Mar 16, 2025, at 7:12 PM, Serhei Makarov wrote:
> > +bool
> > +x86_64_set_initial_registers_sample (const Dwarf_Word *regs, uint32_t 
> > n_regs,
> > +uint64_t regs_mask, uint32_t abi,
> > +ebl_tid_registers_t *setfunc,
> > +void *arg)
> > +{
> > +#if !defined(__x86_64__) || !defined(__linux__)
> > +  return false;
> > +#else /* __x86_64__ */
> Found that coding like this triggers -Werror=unused-parameter on non-x86.
>  I plan to fix this in the next version of the patch.

In some other situations that is "solved" with marking the function
arguments with __attribute__ ((unused)) (which isn't true for x86_64,
but the compiler is fine with that).

Cheers,

Mark


Re: [PATCH 01/13] libebl [1/13]: api for perf register handling, start with x86_64

2025-03-18 Thread Serhei Makarov



On Tue, Mar 18, 2025, at 10:04 AM, Mark Wielaard wrote:
> In some other situations that is "solved" with marking the function
> arguments with __attribute__ ((unused)) (which isn't true for x86_64,
> but the compiler is fine with that).
The other hack (that I'd go with, if there's no style objections)
is a (void)arg; no-op statement in the 'return 0' branch of the ifdef.
It seems cleaner to me since it doesn't mark the arg unused
for both branches.

-- 
All the best,
Serhei