From b2d3b8379cd3aee9d99ac07080da2d0f73b03638 Mon Sep 17 00:00:00 2001 From: acqn Date: Mon, 3 Aug 2020 01:38:54 +0800 Subject: [PATCH] Warning about forward declaration of enum types in non-cc65 modes. --- src/cc65/compile.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cc65/compile.c b/src/cc65/compile.c index ef7dea149..5332caedb 100644 --- a/src/cc65/compile.c +++ b/src/cc65/compile.c @@ -276,6 +276,15 @@ static void Parse (void) Entry->Name, Entry->V.BssName); } Entry->V.BssName = xstrdup (bssName); + + /* Check for enum forward declaration. + ** Warn about it when extensions are not allowed. + */ + if (Size == 0 && IsTypeEnum (Decl.Type)) { + if (IS_Get (&Standard) != STD_CC65) { + Warning ("ISO C forbids forward references to 'enum' types"); + } + } } }