Re: [PATCH 4/5] bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS()
From: Linus Torvalds
Date: Thu Mar 27 2025 - 15:53:10 EST
On Thu, 27 Mar 2025 at 02:36, Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> BTW., any reason why we go all the trouble with the bug_entry::line u16
> number, instead of storing it in the bug_entry::file string with a
> :__LINE__ postfix or so?
The compiler will happily share the same storage for identical
strings, so that was an issue: re-using the same memory for the same
filename being repeated multiple times.
That obviously doesn't work anyway once you add the warning string to
it, so that makes that whole argument go away.
Linus