Hi!
On Mon, 2026-04-13 at 01:13:19 +0200, Samuel Thibault wrote:
> Milos Nikic, le dim. 12 avril 2026 16:09:02 -0700, a ecrit:
> > Here is v2 with the actions pulled out of the asserts so they survive
> > release
> > builds.
> > How does this look?
>
> > @@ -150,7 +150,10 @@ diskfs_start_bootstrap (void)
> > Hurd server bootstrap: bootfs[bootdev] exec ourfs
> > */
> > printf ("\nContinuing on new root filesystem %s:", diskfs_disk_name);
> > - fflush (stdout);
> > + if (fflush (stdout) != 0)
> > + {
> > + assert_backtrace (0);
>
> "0" in the assertion message won't be that much expressive. Better store
> the result in a variable, and assert_backtrace(res == 0).
Depending on how res ends up being used, that might produce warnings
on NDEBUG builds. An alternative pattern for more expressive asserts
is to do something like «assert (! "fflush () failed");» or similar.
Thanks,
Guillem