Subject: Re: fsck build failure with COPTS=-O3
To: None <current-users@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: current-users
Date: 12/13/2006 14:38:06
Tobias Nygren wrote:
> Compiling current userland with -O3 triggers an ancient clobbering issue
> in fsck.
>
> src/sbin/fsck$ COPTS=-O3 USETOOLS=never make
> # compile fsck/fsck.o
> cc -O2 -O3 -Wall -Wstrict-prototypes -Wmissing-prototypes
> -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wreturn-type
> -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra
> -Wno-unused-parameter -Werror -c fsck.c
> cc1: warnings being treated as errors
> fsck.c: In function 'checkfs':
> fsck.c:254: warning: variable 'optbuf' might be clobbered by 'longjmp'
> or 'vfork'
> *** Error code 1
>
> This patch takes care of it. There's probably some better way to enforce
> allocation of variables though.. (?)
Yes, volatile.
--
Christian