From 0706d195ef7814b131ae0cd5b5cbf12d6cd80f0c Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Wed, 4 Nov 2015 02:41:07 +0100 Subject: [PATCH] Oops, a C/C++ little compile problem. In K&R (pure) C all variables used in a context must be declared before the first executable phrase. gcc allowed this C/C++ crossover many years ago. But compilers, like MSVC, will bark at this problems with a quite weird difficult to understand, error message! This small re-arrangement of the code fixes that... --- console/tidy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/console/tidy.c b/console/tidy.c index 9d3fc1e..d3563af 100644 --- a/console/tidy.c +++ b/console/tidy.c @@ -880,13 +880,15 @@ static void optionhelp( TidyDoc tdoc ) static void optiondescribe( TidyDoc tdoc, char *tag ) { + char *result = NULL; + TidyOptionId topt; + printf( "\nNote this help function is UNDOCUMENTED, and still needs work.\n" ); printf( "\n`%s`\n\n", tag ); - TidyOptionId topt = tidyOptGetIdForName( tag ); + topt = tidyOptGetIdForName( tag ); - char *result = NULL; if (topt < N_TIDY_OPTIONS) { result = (char*)tidyOptGetDoc( tdoc, tidyGetOption( tdoc, topt ) );