mikevoyt / protobuf-embedded-c

Automatically exported from code.google.com/p/protobuf-embedded-c
0 stars 0 forks source link

VisualStudio 2012 Compiler error: ISO C89 forbids mixed declarations and code #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While I try compile the automatic generated .c file in Visual Studio 2012 I get 
following error:

error: ISO C89 forbids mixed declarations and code!!!

Is it possible all declarations generate in begin of each function?

The "problematic" code example:

void sameFun()
{
    int a,b;

    a = 5;
    b = a + 3;
    int c = a * b;
}

The "desirable" code example:

void sameFun()
{
    int a,b,c;

    a = 5;
    b = a + 3;
    c = a * b;
}

Original issue reported on code.google.com by magnet...@gmail.com on 27 Feb 2013 at 12:51

GoogleCodeExporter commented 9 years ago
Comparable problem as in issue 21.
Can this be fixed "on the fly" during migration to Xtend-based generator?

Original comment by wolfgang.schwitzer on 13 Mar 2013 at 11:45