![]() |
Gaps in enums - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4) +--- Forum: General Questions (https://forum.misra.org.uk/forumdisplay.php?fid=27) +--- Thread: Gaps in enums (/showthread.php?tid=1750) |
Gaps in enums - delirium5223 - 04-09-2025 Can we have a new rule that says Quote: if enum is used as an iterator type then there shall not be gaps in enum values. Code: typedef enum Surely we would want to know/acknowledge that enum has a gap if we plan to iterate over it. (regardless where the 'for' loop starts/end) It would make a good higher level/abstraction rule. Or at least make it advisory. |