(void)ing unreferenced parameters

Martin Dorey martin.dorey@madge.com
Wed Jun 30 23:07:00 GMT 1999


> You've changed the ground rules.

Yes.  My mistake if I've gone off topic, but...

> I found it hard to understand what you would expect
>  *device;
> to do.

Not disputed.

> You'd like `copy = *device' to happen in one go for efficiency. You
lose.

Yes.  Maybe:

> What you wanted to say is c) reads can be combined and reordered wrt
reads, but
> writes cannot be reordered or combined.

No - I only do one read.  By writing copy = *(volatile*) device, I'm
saying that I don't care how the compiler copies the object, as long as
it's not from cache.  Is it defined whether the compiler reads the
structure members individually, or which order it reads them in?  If so,
then my operation has a defined semantics which I can rely on.  If not,
then I'm saying that I don't care what operations it uses to copy the
object - and it's free to do it however efficiently it can.

>> Scenario: you want to save the whole state of the device in one go.
>> Again, you need to be sure that you're going to read a consistent
state.
>You've changed the ground rules *again*. In the example you gave, you
wanted to
>get the thing on one go for *efficiency*. Now you're saying you need to
get it
>in one go for *consistency*.

No.  That's exactly what I'm saying that I'm _not_ doing.  I'm saying
I'm doing it for *convenience* or *concision* - rather than reading all
the members individually.

--




More information about the Gcc-bugs mailing list