Quoting r. Roland Dreier <[EMAIL PROTECTED]>: > Subject: Re: registering read-only memory > > Michael> What about the patch that I posted? > > Adding the "const" makes sense but adding "volatile" doesn't seem good > to me.
Could you explain why? Since the library never accesses the data, it has no effect except turning off a warning. Volatile says like "this buffer can change without the application writing there", and thats what we have with hardware writing there, no? > I think it's better for the tiny subset of people who really > need "volatile" to add casts. > > - R. > IMO, you cant always do this. If you have a non-volatile variable and cast it to a volatile pointer, compiler is permitted to detect this and ignore the volatile attribute, making the code that polls data incorrect (I'm not claiming gcc is smart enough to do this, though). -- MST - Michael S. Tsirkin _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
