From 2a365bb08ac308b7068b99d80938ec4c5a027593 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 11 Jan 2019 19:13:27 +0000 Subject: [PATCH] testcrypt: fix a technically illegal forward-typedef. Every compiler that's so far seen testcrypt.c has tolerated me writing 'typedef enum ValueType ValueType' before actually saying what 'enum ValueType' is, but one just pointed out that it's not actually legal standard C to do that. Moved the typedef to after the enum. --- testcrypt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testcrypt.c b/testcrypt.c index aa144334..c6f6f0d9 100644 --- a/testcrypt.c +++ b/testcrypt.c @@ -81,7 +81,6 @@ int random_byte(void) /* end of list */ typedef struct Value Value; -typedef enum ValueType ValueType; enum ValueType { #define VALTYPE_ENUM(n,t,f) VT_##n, @@ -89,6 +88,8 @@ enum ValueType { #undef VALTYPE_ENUM }; +typedef enum ValueType ValueType; + const char *const type_names[] = { #define VALTYPE_NAME(n,t,f) #n, VALUE_TYPES(VALTYPE_NAME)