None the less I think this behavior is pretty dangerous without a warning, as I have seen this kind of stuff pretty often.
From the STM32-Hal where I got this code from:
/* Bits of channels in single or differential mode are set only for */
/* differential mode (for single mode, mask of bits allowed to be set is */
/* shifted out of range of bits of channels in single or differential mode. */
As this is a gcc issue and not arm-gcc (the behavior can be seen with x86, too), I discuss that there.
I'm afraid you're right: http:// c0x.coding- guidelines. com/6.5. 7.html# 1185
None the less I think this behavior is pretty dangerous without a warning, as I have seen this kind of stuff pretty often.
From the STM32-Hal where I got this code from:
/* Bits of channels in single or differential mode are set only for */
/* differential mode (for single mode, mask of bits allowed to be set is */
/* shifted out of range of bits of channels in single or differential mode. */
As this is a gcc issue and not arm-gcc (the behavior can be seen with x86, too), I discuss that there.