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

From: Oliver Fromme <olli_at_lurza.secnetix.de>
Date: Mon, 30 Jan 2006 13:12:49 +0100 (CET)
Luigi Rizzo <rizzo_at_icir.org> 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

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
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++
Received on Mon Jan 30 2006 - 11:12:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:51 UTC