I have a 16 bit variable and I want to read the high byte as an 8-bit value. I tried right shifting by 8 bits and casting the value as a uint8_t type. But I do not get the correct value, at least I don't get what I was expecting.
Somewhere\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino/Print.h:30:13: warning: left operand of comma operator has no effect [-Wunused-value]
By default, the compiler warnings are turned off - I suspect the reason is to keep hoards of people from seeing a warning that isn't a problem (since we're all copy-pasting half-assed code all over, which is often full of stuff that gets warnings) and screaming on forums about the warnings, not knowing the difference between a warning and an error.
Anyone whose sketch is not doing what they expect should turn up their warning level to ALL. Often that will put out a warning that indicates a common coding mistake that isn't technically an error.