Skip Navigation
60 comments
  • If you have a memory-mapped peripheral where there's a readonly register, I could see it being const volatile.

  • Looks like they didn't want anybody using the secondary tank. Probably haven't had time to pull Dave's body out yet.

  •  
        
    volatile int blackhole;
    blackhole = 1;
    const int X = blackhole;
    const int Y = blackhole;
    
    
      

    Compiler is forbidden to assume that X == 1 would be true. It's also forbidden to assume that X == Y. const just means the address and/or the data at the address is read only. const volatile int* const hwreg; -> "read only volatile value at read only address hwreg". Compiler can assume the hwreg address won't magically change, but can't assume the value read from that address won't.

60 comments