On Oct 9, 2014, at 1:15 PM, Bruce Cran <[email protected]> wrote:

> On Thu, Oct 9, 2014 at 1:29 PM, Andrew Fish <[email protected]> wrote:
>> 
>> If you add volatile to Value then the loop
>> will check the value on every iteration. If you just use the return value of
>> the functions to return the value, you will always get the correct answer.
> 
> My question was really about the fact that when you add 'volatile' you
> have to cast 'Value' when calling InterlockedIncrement() to avoid a
> warning from gcc (and, I assume clang) that you're discarding the
> 'volatile' qualifier. Since InterlockedIncrement() straight away calls
> into an internal function there won't be a correctness issue.
> 

OK I agree that it forces you to do extra casting if you access the variable 
out side of the functions. You can promote to volatile, but demoting from 
volatile will warn. 

It may actually be backwards compatible to add the volatile keyword to the 
pointers since only the implementations of the functions would need to be 
updated, not the callers. Some one would need to double check the C spec to 
make sure that is correct.

Thanks,

Andrew Fish

> -- 
> Bruce
> 
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to