fossekall
fossekall

Reputation: 521

Visual Microsoft Visual C++ Compiler for Python 2.7 vs MinGW

I am making some functions in c which I am going to call from Python via Cython. I am developing these functions in Code:Block using MinGW C++ compiler. But when building them for Python I have to use Visual Microsoft Visual C++ Compiler for Python 2. Then I have met a strang problem. When compiling with Visual C++ compiler I have after a lot of trial and fail found out that all variables have to be decleared before first in each block (if, for, function). Why is so. Are there difference between compilers for c?

Upvotes: 0

Views: 308

Answers (2)

Bo Persson
Bo Persson

Reputation: 92261

MSVC mostly adheres to the original C89 spec. In later revisions of the language this restriction has been lifted.

Upvotes: 1

Dmitry Rubanovich
Dmitry Rubanovich

Reputation: 2627

In C (proper C rather than C++) the variables have to be declared at the beginning of a block.

Upvotes: 0

Related Questions