diff --git a/Common/ListUtils.cpp b/Common/ListUtils.cpp
index 050ac635f3ae016be317def8d6fb6b2afca4be0b..7284a29cd7f96c49962715781a85009a373384d2 100644
--- a/Common/ListUtils.cpp
+++ b/Common/ListUtils.cpp
@@ -12,7 +12,14 @@
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <stdint.h>
+#ifdef _MSC_VER
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <stdint.h>
+#endif
 #include "MallocUtils.h"
 #include "ListUtils.h"
 #include "TreeUtils.h"
diff --git a/Common/avl.cpp b/Common/avl.cpp
index d49893c67195c3f2119bc2df060de0f513a57ab9..618f7fc6206a7daf821f495365c9bdefab6127be 100644
--- a/Common/avl.cpp
+++ b/Common/avl.cpp
@@ -26,7 +26,14 @@
 // Modified for Gmsh (C++ and 64 bit compatibility)
 
 #include <stdio.h>
-#include <stdint.h>
+#ifdef _MSC_VER
+typedef __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <stdint.h>
+#endif
 
 #include "avl.h"
 #include "MallocUtils.h"
diff --git a/Geo/Curvature.cpp b/Geo/Curvature.cpp
index 20cae44ffb0288644e6d1e728e5ba2c07844a5b2..358daf5f2dacd1771c6f7b6016e49fcfe18af371 100644
--- a/Geo/Curvature.cpp
+++ b/Geo/Curvature.cpp
@@ -64,7 +64,7 @@ void Curvature::retrieveCompounds()
   std::vector<GEntity*> entities;
   _model->getEntities(entities);
   
-  for(int ie = 0; ie < entities.size(); ++ie) {
+  for(unsigned ie = 0; ie < entities.size(); ++ie) {
     
     if(entities[ie]->geomType() == GEntity::CompoundSurface) {
       GFaceCompound* compound = dynamic_cast<GFaceCompound*>(entities[ie]);
@@ -87,9 +87,9 @@ void Curvature::retrieveCompounds()
 // initialization of the map and renumbering of the selected entities
 void Curvature::initializeMap()
 {
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i){
     GFace* face = _ptFinalEntityList[i];
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *e = face->getMeshElement(iElem);
       const int E = e->getNum();
       _ElementToInt[E] = 1;
@@ -132,7 +132,7 @@ void Curvature::computeVertexNormals()
   _VertexArea.resize(_ElementToInt.size() );
   _VertexNormal.resize(_VertexToInt.size());
 
-  for (int i = 0; i < _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i < _ptFinalEntityList.size(); ++i){
     // face is a pointer to one surface of the group "FinalEntityList"
     GFace* face = _ptFinalEntityList[i];
 
@@ -191,12 +191,12 @@ void Curvature::curvatureTensor()
 
   _CurveTensor.resize(_VertexToInt.size());
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i){
     // face is a pointer to one surface of the group "FinalEntityList"
     GFace* face = _ptFinalEntityList[i]; 
 
     //Loop over the element all the element of the "myTag"-surface
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *e = face->getMeshElement(iElem);  //Pointer to one element
       const int E = _ElementToInt[e->getNum()]; //The NEW tag of the corresponding element
 
@@ -344,12 +344,12 @@ void Curvature::computeRusinkiewiczNormals()
   _TriangleArea.resize(_ElementToInt.size() );
   _VertexNormal.resize(_VertexToInt.size());
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i){
     // face is a pointer to one surface of the group "FinalEntityList"
     GFace* face = _ptFinalEntityList[i];
 
     //Loop over the element all the element of the "myTag"-surface
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       // Pointer to one element
       MElement *e = face->getMeshElement(iElem);
       const int E = _ElementToInt[e->getNum()];
@@ -400,13 +400,13 @@ void Curvature::computePointareas()
   _pointareas.resize(_VertexToInt.size());
   _cornerareas.resize(_ElementToInt.size());
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i)
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i)
   {
     //face is a pointer to one surface of the group "FinalEntityList"
     GFace* face = _ptFinalEntityList[i]; 
 
     //Loop over the element all the element of the "myTag"-surface
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *E = face->getMeshElement(iElem);  //Pointer to one element
       // The NEW tag of the corresponding element
       const int EIdx = _ElementToInt[E->getNum()];
@@ -616,7 +616,7 @@ void Curvature::computeCurvature_Rusinkiewicz(int isMax)
     GFace* face = _ptFinalEntityList[i];
 
     //Loop over the element all the element of the "myTag"-surface
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *E = face->getMeshElement(iElem); // Pointer to one element
 
       MVertex* A = E->getVertex(0); // Pointers to vertices of triangle
@@ -634,7 +634,7 @@ void Curvature::computeCurvature_Rusinkiewicz(int isMax)
     }
   }
 
-  for (int ivertex = 0; ivertex < _VertexToInt.size(); ++ivertex){
+  for (unsigned ivertex = 0; ivertex < _VertexToInt.size(); ++ivertex){
     _pdir1[ivertex] = crossprod(_pdir1[ivertex], _VertexNormal[ivertex]);
     _pdir1[ivertex].normalize();
     _pdir2[ivertex] = crossprod(_VertexNormal[ivertex], _pdir1[ivertex]);
@@ -768,9 +768,9 @@ void Curvature::computeCurvature_RBF()
   
   // fill set of MVertex
   std::set<MVertex*> allNodes;
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i)  {
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i)  {
     GFaceCompound* face = (GFaceCompound*)_ptFinalEntityList[i];
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++) {
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++) {
       MElement *e = face->getMeshElement(iElem);
       for(int j = 0; j < e->getNumVertices(); j++){
         allNodes.insert(e->getVertex(j));
@@ -974,10 +974,10 @@ void Curvature::writeToPosFile( const std::string & filename)
   
   int idxelem = 0;
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i) {
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i) {
     GFace* face = _ptFinalEntityList[i]; 
 
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *e = face->getMeshElement(iElem);  
       const int E = _ElementToInt[e->getNum()]; 
       //std::cout << "We are now looking at element Nr: " << E << std::endl;
@@ -1047,7 +1047,7 @@ void Curvature::writeToVtkFile( const std::string & filename)
   std::vector<VtkPoint> coord;
   coord.resize(npoints);
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i){
     GFace* face = _ptFinalEntityList[i];
 
     for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
@@ -1092,7 +1092,7 @@ void Curvature::writeToVtkFile( const std::string & filename)
   outfile << std::endl << "CELLS " << _ElementToInt.size() << " " 
           << 4*_ElementToInt.size() << std::endl;
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i){
     GFace* face = _ptFinalEntityList[i];
 
     for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
@@ -1139,12 +1139,12 @@ void Curvature::writeDirectionsToPosFile( const std::string & filename)
   outfile.open(filename.c_str());
   outfile << "View \"Curvature_DirMax \"{" << std::endl;
 
-  for (int i = 0; i< _ptFinalEntityList.size(); ++i){
+  for (unsigned i = 0; i< _ptFinalEntityList.size(); ++i){
     //face is a pointer to one surface of the group "FinalEntityList"
     GFace* face = _ptFinalEntityList[i];
 
     //Loop over the element all the element of the "myTag"-surface
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *e = face->getMeshElement(iElem);  //Pointer to one element
       const int E = _ElementToInt[e->getNum()]; //The NEW tag of the corresponding element
       
@@ -1183,7 +1183,7 @@ void Curvature::writeDirectionsToPosFile( const std::string & filename)
   for (int i = 0; i< _ptFinalEntityList.size(); ++i){
     GFace* face = _ptFinalEntityList[i];
     
-    for (int iElem = 0; iElem < face->getNumMeshElements(); iElem++){
+    for (unsigned iElem = 0; iElem < face->getNumMeshElements(); iElem++){
       MElement *e = face->getMeshElement(iElem); //Pointer to one element
       const int E = _ElementToInt[e->getNum()]; //The NEW tag of the corresponding element
       
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 1e9e2b3095601ae2b144e98d8e91eef687ea25e7..9c4e4f92a2acd7f543e8bd0a3c4847d18b1ab85e 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -572,7 +572,7 @@ int GModel::adaptMesh(int technique, simpleFunction<double> *f, std::vector<doub
       if (getDim() == 2){
 	for (fiter fit = firstFace(); fit != lastFace(); ++fit){
 	  if ((*fit)->quadrangles.size())return -1;
-	  for (int i=0;i<(*fit)->triangles.size();i++){
+	  for (unsigned i=0;i<(*fit)->triangles.size();i++){
 	    elements.push_back((*fit)->triangles[i]);
 	  }
 	}
@@ -580,7 +580,7 @@ int GModel::adaptMesh(int technique, simpleFunction<double> *f, std::vector<doub
       else if (getDim() == 3){
 	for (riter rit = firstRegion(); rit != lastRegion(); ++rit){
 	  if ((*rit)->hexahedra.size())return -1;
-	  for (int i=0;i<(*rit)->tetrahedra.size();i++){
+	  for (unsigned i=0;i<(*rit)->tetrahedra.size();i++){
 	    elements.push_back((*rit)->tetrahedra[i]);
 	  }
 	}
@@ -1741,7 +1741,7 @@ void GModel::createTopologyFromFaces(std::vector<discreteFace*> &discFaces, int
     //EMI RBF fix
     if (ignoreHoles && nbBounds > 0){
       int index = 0;
-      int boundSize = 0;
+      unsigned boundSize = 0;
       for (int ib = 0; ib < nbBounds; ib++){
 	if (boundaries[ib].size() > boundSize){
 	  boundSize = boundaries[ib].size() ;
@@ -1754,7 +1754,7 @@ void GModel::createTopologyFromFaces(std::vector<discreteFace*> &discFaces, int
     }
 
     // create new discrete edges
-    for (int ib = 0; ib < boundaries.size(); ib++){
+    for (unsigned ib = 0; ib < boundaries.size(); ib++){
       int numE = getMaxElementaryNumber(1) + 1;
       discreteEdge *e = new discreteEdge(this, numE, 0, 0);
       add(e);
diff --git a/Geo/MHexahedron.cpp b/Geo/MHexahedron.cpp
index 66cb52a2ec6a442b55001d494d7834a04fee16dc..4f63c255266ee0537bbaf8f5bef898905ddfa801 100644
--- a/Geo/MHexahedron.cpp
+++ b/Geo/MHexahedron.cpp
@@ -173,7 +173,7 @@ static void _myGetFaceRep(MHexahedron *hex, int num, double *x, double *y, doubl
   int iVertex4 = hex->faces_hexa(iFace,3);
 
   SPoint3 pnt1, pnt2, pnt3;
-  double J1[3][3], J2[3][3], J3[3][3];
+ // double J1[3][3], J2[3][3], J3[3][3];
 
   /*
     0
diff --git a/Numeric/BergotBasis.cpp b/Numeric/BergotBasis.cpp
index b0668cc617644a15e9fb58f4b39b209ceda6e911..636c6e500bce4d0c3666f85730385b10e18fe31c 100644
--- a/Numeric/BergotBasis.cpp
+++ b/Numeric/BergotBasis.cpp
@@ -47,12 +47,13 @@ int BergotBasis::size() const {
 void BergotBasis::f(double u, double v, double w, double* val) const {
 
   double uhat = (w == 1.) ? 1 : u/(1.-w);
-  double uFcts[order+1];
-  legendre->f(uhat,uFcts);
+  
+  std::vector<double> uFcts(order+1);
+  legendre->f(uhat,&(uFcts[0]));
 
   double vhat = (w == 1.) ? 1 : v/(1.-w);
-  double vFcts[order+1];
-  legendre->f(vhat,vFcts);
+  std::vector<double> vFcts(order+1);
+  legendre->f(vhat,&(vFcts[0]));
 
   double what = 2.*w - 1.;
   std::map<int,double* > wFcts;
@@ -88,17 +89,17 @@ void BergotBasis::f(double u, double v, double w, double* val) const {
 }
 
 void BergotBasis::df(double u, double v, double w, double grads[][3]) const {
-  double uFcts[order+1];
-  legendre->f(u,uFcts);
-  
-  double uGrads[order+1];
-  legendre->df(u,uGrads);
+  std::vector<double> uFcts(order+1);
+  legendre->f(u,&(uFcts[0]));
+
+  std::vector<double> uGrads(order+1);  
+  legendre->df(u,&(uGrads[0]));
 
-  double vFcts[order+1];
-  legendre->f(v,vFcts);
+  std::vector<double> vFcts(order+1);  
+  legendre->f(v,&(vFcts[0]));
 
-  double vGrads[order+1];
-  legendre->df(v,vGrads);
+ std::vector<double> vGrads(order+1);
+  legendre->df(v,&(vGrads[0]));
 
 
   std::map<int,double* > wFcts;
diff --git a/Numeric/jacobiPolynomials.cpp b/Numeric/jacobiPolynomials.cpp
index b3184eaa78d8df00ab19920a47353eb4d81292f9..911a1d0ed38080a87eb0b454c7ec75bf8ed6d623 100644
--- a/Numeric/jacobiPolynomials.cpp
+++ b/Numeric/jacobiPolynomials.cpp
@@ -35,8 +35,8 @@ void JacobiPolynomials::f(double u, double *val) const {
 
 void JacobiPolynomials::df(double u, double *val) const {
 
-  double tmp[n+1];
-  f(u,tmp);
+  std::vector<double> tmp(n+1);
+  f(u,&(tmp[0]));
   
   val[0] = 0;
   if (n>=1) val[1] = 0.5*(alphaPlusBeta + 2.);
diff --git a/Numeric/legendrePolynomials.cpp b/Numeric/legendrePolynomials.cpp
index 2b229ec692954d13c1956607f5840c726b43bdb2..397c59e0f504c16ac68fcd9d2178dd20a01090dd 100644
--- a/Numeric/legendrePolynomials.cpp
+++ b/Numeric/legendrePolynomials.cpp
@@ -19,8 +19,8 @@ void LegendrePolynomials::f(double u, double *val) const {
 }
 
 void LegendrePolynomials::df(double u, double *val) const {
-  double tmp[n+1];
-  f(u,tmp);
+  std::vector<double> tmp(n+1);
+  f(u,&(tmp[0]));
 
   val[0] = 0;  
   double g2 = (1.-u*u);
diff --git a/Plugin/AnalyseCurvedMesh.cpp b/Plugin/AnalyseCurvedMesh.cpp
index 571fd987b98de092587dc774fd006cda9b898b34..c3c20a85db863b801a1afa075ece7564a437e97f 100644
--- a/Plugin/AnalyseCurvedMesh.cpp
+++ b/Plugin/AnalyseCurvedMesh.cpp
@@ -317,6 +317,7 @@ PView *GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
     new PView("Jmin", "ElementData", _m, data);
     Msg::Info("Done computation J_min, J_max (%fs)", Cpu()-t);
   }
+  return 0;
 }
 
 void GMSH_AnalyseCurvedMeshPlugin::checkValidity(int toDo)