for review: sys/dev/md/md.c patch

Luigi Rizzo rizzo at
Mon Jan 30 04:54:48 PST 2006

On Mon, Jan 30, 2006 at 01:12:49PM +0100, Oliver Fromme wrote:
> Luigi Rizzo <rizzo at> wrote:
>  > just discovered, trying to resurrect picobsd on -current,
>  > that the compiler in 6.x/7.x has become smart and, at least
>  > with the default compilation flags, will optimize out
>  > the "end_mfs_root" string from the object.
> Shouldn't it be sufficient to declare the string as volatile?
> That should prevent it from being optimized by the compiler.

but packing both into the same struct also solves the issue
of compiler potentially rearranging the variables in memory,
and since we want them contiguous, the approach i suggested is
probably more appropriate (with compilers becoming smarter
and smarter, that is...)


> (I'm not questioning your solution, mind you.  I just wonder
> if "volatile" would do the job.  So far I've used volatile
> for things like sig_atomic_t only.)
> Best regards
>    Oliver
> -- 
> Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
> Dienstleistungen mit Schwerpunkt FreeBSD:
> Any opinions expressed in this message may be personal to the author
> and may not necessarily reflect the opinions of secnetix in any way.
> "When your hammer is C++, everything begins to look like a thumb."
>         -- Steve Haflich, in comp.lang.c++
> _______________________________________________
> freebsd-current at mailing list
> To unsubscribe, send any mail to "freebsd-current-unsubscribe at"

More information about the freebsd-current mailing list