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...
This commit is contained in:
Geoff McLane 2015-11-04 02:41:07 +01:00
parent 02909b5fe3
commit 0706d195ef
1 changed files with 4 additions and 2 deletions

View File

@ -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 ) );