
28 Oct
2016
28 Oct
'16
4:58 p.m.
On Freitag, 28. Oktober 2016 01:52:26 CEST Marek Vasut wrote: [...]
+enum fdt_fsl_usb_erratum {
- A006261,
- A007075,
- A007792,
- A005697,
- A008751,
- FSL_USB_ERRATUM_END
The compiler can assign completely arbitrary numbers to the enum elements. Moreover, you don't need this "terminating entry" anyway, see below.
Not true. According to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
6.7.2.2 Enumeration specifiers ... An enumerator with = defines its enumeration constant as the value of the constant expression. If the first enumerator has no =, the value of its enumeration constant is 0. Each subsequent enumerator with no = defines its enumeration constant as the value of the constant expression obtained by adding 1 to the value of the previous enumeration constant.
Kind regards,
Stefan