Re: [PATCH v2 1/7] banned-die: create header for banning of functions
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Aug 31, 2026, 12:29 UTC
- Message-ID
- <4f9348a8-b71a-4583-8451-99ade6fced89@gmail.com>
- In-Reply-To
- <CABPp-BHtmjSqkgL+RL=nmd1VNqqZ6vDUhQxj0AnEzAHZxznoHw@mail.gmail.com>
On 8/25/2026 6:14 PM, Elijah Newren wrote:
Show 10 quoted lines
> On Tue, Aug 25, 2026 at 11:58 AM Derrick Stolee via GitGitGadget > <gitgitgadget@gmail.com> wrote: >> > [...] >> +#undef die >> +#define die banned(die) > > Shouldn't that be BANNED(die) to match all the other cases in the code > (and avoid an obtuse "implicit declaration of function 'banned'" > instead of the nicer "sorry_die_is_a_banned_function" message)?
Oops. Yes, a mistake during a rebase.
Show 16 quoted lines
>> + >> +#endif /* BANNED_DIE_H */ >> diff --git a/trace2.c b/trace2.c >> index c23c0a227b..1d0ed2db2b 100644 >> --- a/trace2.c >> +++ b/trace2.c >> @@ -17,6 +17,7 @@ >> #include "trace2/tr2_tgt.h" >> #include "trace2/tr2_tls.h" >> #include "trace2/tr2_tmr.h" >> +#include "banned-die.h" >> > > Is there a risk that future folks add new includes at the end of the > list, then functions in them get added to banned-die.h, but are > silently ignored because banned-die.h wasn't the last include?
There is a risk. The "must be last" part is documented in the header, but maybe it should be in a comment here, too.
Thanks, -Stolee