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

Oliver Fromme olli at
Mon Jan 30 04:12:59 PST 2006

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.

(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 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++

More information about the freebsd-current mailing list