Closed NeKzor closed 3 months ago
It's UB to define a higher value first SAR_DATA_CHECKSUM (0xFF) and then a lower value next SAR_DATA_CHECKSUM_V2 (0xFE) because the compiler might just define 0xFF again for SAR_DATA_INVALID.
SAR_DATA_CHECKSUM
SAR_DATA_CHECKSUM_V2
SAR_DATA_INVALID
https://github.com/p2sr/mdp/blob/4a580f63eb5c70bd1371153f2ff1ad219a1598fa/src/demo.h#L32-L35
See the result on compiler explorer: https://godbolt.org/z/x68qKGff3
It's UB to define a higher value first
SAR_DATA_CHECKSUM
(0xFF) and then a lower value nextSAR_DATA_CHECKSUM_V2
(0xFE) because the compiler might just define 0xFF again forSAR_DATA_INVALID
.https://github.com/p2sr/mdp/blob/4a580f63eb5c70bd1371153f2ff1ad219a1598fa/src/demo.h#L32-L35
See the result on compiler explorer: https://godbolt.org/z/x68qKGff3