diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp
index cf7a5cea08dee76eee7ca25e8f9b43173cadf88c..3035e2e1ccba4c68acccd53155d036a26a0f9337 100644
--- a/Common/CreateFile.cpp
+++ b/Common/CreateFile.cpp
@@ -441,7 +441,7 @@ void CreateOutputFile(std::string fileName, int format)
         break;
       }
       int numViews = (int)opt_post_nb_views(0, GMSH_GET, 0), numSteps = 0;
-      for(unsigned int i = 0; i < numViews; i++){
+      for(int i = 0; i < numViews; i++){
         if(opt_view_visible(i, GMSH_GET, 0))
           numSteps = std::max(numSteps, (int)opt_view_nb_timestep(i, GMSH_GET, 0));
       }
diff --git a/Common/GmshRemote.cpp b/Common/GmshRemote.cpp
index 17f3a35eb36cc10743788a0c835c085af0dfc9d7..8c6156230f950b411ab151f30bcde8790144894a 100644
--- a/Common/GmshRemote.cpp
+++ b/Common/GmshRemote.cpp
@@ -59,10 +59,10 @@ static void computeAndSendVertexArrays(GmshClient *client, bool compute=true)
 #endif
 }
 
+#if defined(HAVE_POST) && defined(HAVE_MPI)
 // This version sends VArrays using MPI
 static void computeAndSendVertexArrays()
 {
-#if defined(HAVE_POST) && defined(HAVE_MPI)
   // compute...
   for(unsigned int i = 0; i < PView::list.size(); i++)
     PView::list[i]->fillVertexArrays();
@@ -95,7 +95,6 @@ static void computeAndSendVertexArrays()
       }
     }
   }
-#endif
 }
 
 // Merge the vertex arrays
@@ -104,12 +103,11 @@ static void addToVertexArrays(int length, const char* bytes, int swap)
   std::string name;
   int num, type, numSteps;
   double min, max, time, xmin, ymin, zmin, xmax, ymax, zmax;
-  int index = VertexArray::decodeHeader(length, bytes, swap, name, num, type, min, max,
-                                        numSteps, time, xmin, ymin, zmin, xmax, ymax, zmax);
+  VertexArray::decodeHeader(length, bytes, swap, name, num, type, min, max,
+                            numSteps, time, xmin, ymin, zmin, xmax, ymax, zmax);
 
   PView *p = PView::list[num - 1];
   PViewData *data = p->getData();
-  PViewOptions *opt = p->getOptions();
   
   VertexArray *varrays[4] = 
     {p->va_points, p->va_lines, p->va_triangles, p->va_vectors};
@@ -131,6 +129,7 @@ static void addToVertexArrays(int length, const char* bytes, int swap)
   va->merge(toAdd);
   delete toAdd;
 }
+#endif
 
 static void gatherAndSendVertexArrays(GmshClient* client, bool swap)
 {
diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp
index 2cdc12e9a29ab488be00d72f6fcd399e348504e8..f2f6978b6cc8d3e7d1af76bd32b5360462e580e5 100644
--- a/Common/LuaBindings.cpp
+++ b/Common/LuaBindings.cpp
@@ -142,13 +142,13 @@ static void printMethod(std::string name, luaMethodBinding *mb, bool isConstruct
     std::cout << colorBold<<argTypeNames[0];
   std::cout << colorBlue << " " << name << colorDefault << colorBold << " (";
   int count = 0;
-  for(int i = 1; i < argTypeNames.size(); i++){
+  for(unsigned int i = 1; i < argTypeNames.size(); i++){
     if(argTypeNames[i] == "-1")
       continue;
     if(count != 0)
       std::cout << ", ";
     std::cout << colorBold<<argTypeNames[i] << colorDefault;
-    if(mb->getArgNames().size() > count)
+    if((int)mb->getArgNames().size() > count)
       std::cout << " " << mb->getArgNames()[count];
     count++;
   }
@@ -263,8 +263,8 @@ int binding::readFile(const char *filename)
 static int countInArguments(const std::vector<std::string> &types)
 {
   int c = 0;
-  for(int i = 1; i < types.size(); i++)
-    c+=(types[i] != "-1");
+  for(unsigned int i = 1; i < types.size(); i++)
+    c += (types[i] != "-1");
   return c;
 }
 
diff --git a/Common/LuaBindings.h b/Common/LuaBindings.h
index d5f81778a0d49481f1ffd2d03f3354faedecf897..86b5bba273bafe905b3121f0ffc922ecab5c6a75 100644
--- a/Common/LuaBindings.h
+++ b/Common/LuaBindings.h
@@ -1297,7 +1297,7 @@ class classBinding {
     lua_setfield(L, metatable, "__tostring");
 
     lua_newtable(L);
-    int mt = lua_gettop(L);
+    //int mt = lua_gettop(L);
 
     lua_setmetatable(L, methods); // setmetatable(methods, mt)
     lua_pop(L, 2);  // drop metatable and method table
diff --git a/Common/StringUtils.cpp b/Common/StringUtils.cpp
index edc599eb56c8553bdf98b412a05d1f830f0426f2..d7597d40219c7b868f07165317024fc939f46dc3 100644
--- a/Common/StringUtils.cpp
+++ b/Common/StringUtils.cpp
@@ -93,8 +93,8 @@ std::vector<std::string> SplitFileName(const std::string &fileName)
   // returns [path, baseName, extension]
   int idot = fileName.find_last_of('.');
   int islash = fileName.find_last_of("/\\");
-  if(idot == std::string::npos) idot = -1;
-  if(islash == std::string::npos) islash = -1;
+  if(idot == (int)std::string::npos) idot = -1;
+  if(islash == (int)std::string::npos) islash = -1;
   std::vector<std::string> s(3);
   if(idot > 0)
     s[2] = fileName.substr(idot);
@@ -126,7 +126,7 @@ void ReplaceSubStringInPlace(const std::string &olds, const std::string &news,
 {
   while(1){
     int pos = str.find(olds.c_str());
-    if(pos == std::string::npos) break;
+    if(pos == (int)std::string::npos) break;
     str.replace(pos, olds.size(), news.c_str());
   }
 }
diff --git a/Fltk/pluginWindow.cpp b/Fltk/pluginWindow.cpp
index f2431111dfa75f945108851475121eb90f652235..8a3e64eb8c39cb952e03cc19a44dd9ed3ab46c7d 100644
--- a/Fltk/pluginWindow.cpp
+++ b/Fltk/pluginWindow.cpp
@@ -115,7 +115,7 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view)
   int oldIndex = -1;
   if(view){
     for(int i = 0; i < p->getNbOptions(); i++){
-      if(p->getOption(i)->str == "View") {
+      if(std::string(p->getOption(i)->str) == "View") {
         oldIndex = (int)(p->getOption(i)->def);
         p->getOption(i)->def = view->getIndex();
       }
@@ -137,7 +137,7 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view)
 
   if(view && oldIndex != -1){
     for(int i = 0; i < p->getNbOptions(); i++){
-      if(p->getOption(i)->str == "View"){
+      if(std::string(p->getOption(i)->str) == "View"){
         p->getOption(i)->def = oldIndex;
       }
     }
diff --git a/Fltk/solverWindow.cpp b/Fltk/solverWindow.cpp
index 4775cee131ade305102f1b73d01eb7e8dbbc6c37..ce132c8178954a67c87cb39bc4a4b5e5d0563f1d 100644
--- a/Fltk/solverWindow.cpp
+++ b/Fltk/solverWindow.cpp
@@ -30,7 +30,7 @@ class FlGmshServer : public GmshServer{
  private:
   ConnectionManager *_remote;
  public:
-  FlGmshServer(ConnectionManager *remote) : _remote(remote), GmshServer() {}
+  FlGmshServer(ConnectionManager *remote) : GmshServer(), _remote(remote) {}
   ~FlGmshServer() {}
   int SystemCall(const char *str)
   { 
diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp
index e761daa3cf8b17f897b35aaa6b326f09971473c4..df0e0bf60a68a89d1a3ad8977c14e9c880f03416 100644
--- a/Fltk/visibilityWindow.cpp
+++ b/Fltk/visibilityWindow.cpp
@@ -53,7 +53,7 @@ class VisModel : public Vis {
   int _tag;
  public:
   VisModel(GModel *model, int tag, std::string &name)
-    : _model(model), _tag(tag), Vis(name) {}
+    : Vis(name), _model(model), _tag(tag) {}
   ~VisModel(){}
   int getTag() const { return _tag; }
   std::string getType() const { return "Model"; }
@@ -65,7 +65,7 @@ class VisElementary : public Vis {
  private:
   GEntity *_e;
  public:
-  VisElementary(GEntity *e, std::string &name) : _e(e), Vis(name) {}
+  VisElementary(GEntity *e, std::string &name) : Vis(name), _e(e) {}
   ~VisElementary(){}
   int getTag() const { return _e->tag(); }
   int getDim() const { return _e->dim(); }
@@ -90,7 +90,7 @@ class VisPhysical : public Vis {
   std::vector<GEntity*> _list;
  public:
   VisPhysical(int tag, int dim, std::vector<GEntity*> list, std::string &name) 
-    : _tag(tag), _dim(dim), _visible(1), _list(list), Vis(name)  {}
+    : Vis(name), _tag(tag), _dim(dim), _visible(1), _list(list)  {}
   ~VisPhysical(){}
   int getTag() const { return _tag; }
   int getDim() const { return _dim; }
diff --git a/Geo/Cell.cpp b/Geo/Cell.cpp
index 197594c75563ffd75e1129e4ac3b17ba69b10378..f9b67aeef00f9e13cb2246b34d102e14d698ac32 100755
--- a/Geo/Cell.cpp
+++ b/Geo/Cell.cpp
@@ -29,8 +29,8 @@ bool Less_Cell::operator()(const Cell* c1, const Cell* c2) const
 }
 
 Cell::Cell(MElement* image) :  
-  _combined(false), _index(0), _immune(false), _image(NULL), 
-  _delimage(false), _subdomain(false) 
+  _subdomain(false), _combined(false), _index(0), _immune(false), _image(NULL), 
+  _delimage(false)
 {
   _image = image;
   for(int i = 0; i < getNumVertices(); i++) 
diff --git a/Geo/Cell.h b/Geo/Cell.h
index 0239b05a519be0f35c60ad6087357e58b68c3086..07126932bbe17424128f2fe18e75446a1afff5d9 100644
--- a/Geo/Cell.h
+++ b/Geo/Cell.h
@@ -78,8 +78,8 @@ class Cell
   
  public:
 
- Cell() : _combined(false), _index(0), _immune(false), _image(NULL), 
-    _delimage(false), _subdomain(false) {}
+  Cell() : _subdomain(false), _combined(false), _index(0), _immune(false), _image(NULL), 
+    _delimage(false) {}
   Cell(MElement* image);
   ~Cell();
 
diff --git a/Geo/CellComplex.cpp b/Geo/CellComplex.cpp
index b7635c7461c8cf297e89d424169a38c0c3799e90..9d6cc52047b2eeb643d78c142a159a8fe55a455a 100644
--- a/Geo/CellComplex.cpp
+++ b/Geo/CellComplex.cpp
@@ -170,7 +170,6 @@ int CellComplex::coreduction(Cell* startCell, bool omit,
   std::map<Cell*, int, Less_Cell > cbd_c;
 
   Cell* s;
-  int round = 0;
   while( !Q.empty() ){
     s = Q.front();
     Q.pop();
@@ -203,7 +202,6 @@ int CellComplex::reduction(int dim, bool omit,
   int count = 0;
   
   bool reduced = true;
-  bool ignoreCells = true;
   while (reduced){
 
     reduced = false;
@@ -237,7 +235,6 @@ int CellComplex::coreduction(int dim, bool omit,
   int count = 0;
 
   bool reduced = true;
-  bool ignoreCells = true;
   while (reduced){
 
     reduced = false;
diff --git a/Geo/ChainComplex.cpp b/Geo/ChainComplex.cpp
index 261335b0774a27b3469d62413c6351cb2b8dfe24..7405b11d8657dec1e3c240bcd1f41182ab4fbccc 100644
--- a/Geo/ChainComplex.cpp
+++ b/Geo/ChainComplex.cpp
@@ -453,7 +453,7 @@ void ChainComplex::getBasisChain(std::map<Cell*, int, Less_Cell>& chain,
   if(basisMatrix == NULL
      || (int)gmp_matrix_cols(basisMatrix) < num) return;
 
-  int rows = gmp_matrix_rows(basisMatrix);
+  //int rows = gmp_matrix_rows(basisMatrix);
 
   int elemi;
   long int elemli;
diff --git a/Geo/GEntity.cpp b/Geo/GEntity.cpp
index d7f79ea82299f5a6469b53ef75ca96a1f41694be..980f48f5b7e199e5b18ce8ed6b901ddcfb69fb8e 100644
--- a/Geo/GEntity.cpp
+++ b/Geo/GEntity.cpp
@@ -16,9 +16,8 @@
 #include "GRegion.h"
 
 GEntity::GEntity(GModel *m, int t)
-  : _model(m), _tag(t), _visible(1), _selection(0),
-    _allElementsVisible(1), _obb(0), va_lines(0), va_triangles(0),
-    _meshMaster(t)
+  : _model(m), _tag(t), _meshMaster(t), _visible(1), _selection(0),
+    _allElementsVisible(1), _obb(0), va_lines(0), va_triangles(0)
 {
   _color = CTX::instance()->packColor(0, 0, 255, 0);
 }
diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp
index 1c4ae412baf7d67373b67b110b71fe2e6c229bc7..89f2f13e2fdba3f8700dc8419abc1eb9788d12de 100644
--- a/Geo/GFaceCompound.cpp
+++ b/Geo/GFaceCompound.cpp
@@ -837,22 +837,7 @@ GFaceCompound::~GFaceCompound()
   if (_lsys)delete _lsys;
 }
 
-static void boundVertices(const std::list<GEdge*> &e, std::vector<MVertex*> &l){
-
-  l.clear();
-  std::list<GEdge*>::const_iterator it = e.begin();
-  for( ; it != e.end(); ++it ){
-    for(unsigned int i = 0; i < (*it)->lines.size(); i++ ){
-      MVertex *v0 = (*it)->lines[i]->getVertex(0);
-      MVertex *v1 = (*it)->lines[i]->getVertex(1); 
-      std::list<GEdge*>::const_iterator it = e.begin();
-      if (std::find(l.begin(), l.end(), v0) == l.end())  l.push_back(v0);
-      if (std::find(l.begin(), l.end(), v1) == l.end())  l.push_back(v1);
-    }
-  }
-
-}
-//order Vertices of a closed loop
+// order vertices of a closed loop
 static bool orderVertices(const std::list<GEdge*> &e, std::vector<MVertex*> &l,
                           std::vector<double> &coord)
 {
@@ -1073,12 +1058,10 @@ void GFaceCompound::parametrize(iterationStep step, typeOfMapping tom) const
   double t1 = Cpu();  
   
   femTerm<double> *mapping;
-  if (tom == HARMONIC){
+  if (tom == HARMONIC)
     mapping = new laplaceTerm(0, 1, &ONE);
-  }
-  else if (tom == CONVEXCOMBINATION){
+  else // tom == CONVEXCOMBINATION
     mapping = new convexCombinationTerm(0, 1, &ONE);
-  }
   
   it = _compound.begin();
   for( ; it != _compound.end() ; ++it){
@@ -1124,6 +1107,10 @@ bool GFaceCompound::parametrize_conformal_spectral() const
   std::vector<MVertex*> ordered;
   std::vector<double> coords;  
   bool success = orderVertices(_U0, ordered, coords);
+  if(!success){
+    Msg::Error("Could not order vertices on boundary");
+    return false;
+  }
 
   linearSystem <double> *lsysA  = new linearSystemPETSc<double>;
   linearSystem <double> *lsysB  = new linearSystemPETSc<double>;
@@ -1211,7 +1198,6 @@ bool GFaceCompound::parametrize_conformal_spectral() const
        k = k+2;
      }
      k = 0;
-     double norm2 = 0.0;
      for(std::set<MVertex *>::iterator itv = allNodes.begin(); itv !=allNodes.end() ; ++itv){
        MVertex *v = *itv;
        double paramu = ev[k].real()/Linfty;
diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 86fa28bfc04ae1af60f5db78715f32a3358a5cb3..d91dbfb76ee48ea95c824b2d79a2a4b976d79762 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -1130,7 +1130,7 @@ int GModel::removeDuplicateMeshVertices(double tolerance)
         }
         verts.push_back(*it);
       }
-      if(verts.size() == e->getNumVertices()){
+      if((int)verts.size() == e->getNumVertices()){
         MElementFactory factory;
         MElement *e2 = factory.create(e->getTypeForMSH(), verts, e->getNum(),
                                       e->getPartition());
diff --git a/Geo/GModelFactory.cpp b/Geo/GModelFactory.cpp
index e8ef2668f76664048a6c3f9d6b23440d346b2a40..a77c2d3693fa52a7033104a63ad3aa175bb1f759 100644
--- a/Geo/GModelFactory.cpp
+++ b/Geo/GModelFactory.cpp
@@ -122,7 +122,6 @@ GEdge *OCCFactory::addSpline(GModel *gm, const splineType &type,
   OCCVertex *occv1 = dynamic_cast<OCCVertex*>(start);
   OCCVertex *occv2 = dynamic_cast<OCCVertex*>(end);
 
-  OCCEdge *occEd = 0;
   int nbControlPoints = points.size();
   TColgp_Array1OfPnt ctrlPoints(1, nbControlPoints + 2);
   int index = 1;
@@ -139,7 +138,7 @@ GEdge *OCCFactory::addSpline(GModel *gm, const splineType &type,
     else
       occEdge = BRepBuilderAPI_MakeEdge(Bez).Edge();
   } 
-  return gm->_occ_internals->addEdgeToModel(gm,occEdge);
+  return gm->_occ_internals->addEdgeToModel(gm, occEdge);
 }
 
 
@@ -220,7 +219,7 @@ GEntity *OCCFactory::revolve(GModel *gm, GEntity* base,
   gp_Ax1 axisOfRevolution(gp_Pnt(x1, y1, z1), direction);
   BRepPrimAPI_MakeRevol MR(*(TopoDS_Shape*)base->getNativePtr(), 
                            axisOfRevolution, angle, Standard_False);
-  GEntity *ret;
+  GEntity *ret = 0;
   if (base->cast2Vertex()){
     TopoDS_Edge result = TopoDS::Edge(MR.Shape());
     ret = gm->_occ_internals->addEdgeToModel(gm, result);
@@ -254,9 +253,7 @@ GEntity *OCCFactory::extrude(GModel *gm, GEntity* base,
 
   BRepPrimAPI_MakePrism MP(*(TopoDS_Shape*)base->getNativePtr(), direction, 
                            Standard_False);
-
-  GEntity *ret;
-  
+  GEntity *ret = 0;
   if (base->cast2Vertex()){
     TopoDS_Edge result = TopoDS::Edge(MP.Shape());
     ret = gm->_occ_internals->addEdgeToModel(gm, result);
@@ -663,8 +660,7 @@ GEntity * OCCFactory::addPipe (GModel *gm, GEntity *base, std::vector<GEdge *> w
   }
   TopoDS_Wire myWire = wire_maker.Wire();
   
-
-  GEntity *ret;
+  GEntity *ret = 0;
   if (base->cast2Vertex()){
     OCCVertex *occv = dynamic_cast<OCCVertex*>(base);
     BRepOffsetAPI_MakePipe myNiceLittlePipe (myWire,occv->getShape());
@@ -686,7 +682,4 @@ GEntity * OCCFactory::addPipe (GModel *gm, GEntity *base, std::vector<GEdge *> w
   return ret;
 }
 
-
-
-
 #endif
diff --git a/Geo/GModelIO_ACIS.cpp b/Geo/GModelIO_ACIS.cpp
index 5459d704df2f4ea6f09144b679ba8ad72c9f348b..0c0d7da397a5067fabdb3d1cc7ab65abb947a73a 100644
--- a/Geo/GModelIO_ACIS.cpp
+++ b/Geo/GModelIO_ACIS.cpp
@@ -42,69 +42,63 @@ class GMSH_MESH_MANAGER : public MESH_MANAGER {
     : _gm(gm)
   {    
   }
-  virtual ~GMSH_MESH_MANAGER() {
+  virtual ~GMSH_MESH_MANAGER()
+  {
   }
-
-  virtual void begin_mesh_output(
-	ENTITY *entity,	 
-	ENTITY *app_ref, 
-	ENTITY *format) {
+  virtual void begin_mesh_output(ENTITY *entity, ENTITY *app_ref, ENTITY *format)
+  {
     FACE *acisFace = dynamic_cast<FACE*>(entity);
     if (!acisFace)return;    
     _current = getACISFaceByNativePtr (_gm,acisFace);
   }
-
-
-  virtual void announce_counts(
-	int npoly,
-	int nnode,
-	int nref){
+  virtual void announce_counts(int npoly, int nnode, int nref)
+  {
     _current->stl_vertices.resize(nnode);
     _current->stl_triangles.resize(nref);
   }
-
-  virtual logical need_indexed_polygons(){
+  virtual logical need_indexed_polygons()
+  {
     return 1;
   }
-  
-  virtual void announce_indexed_polynode (int ipoly, int i, void *pnode);
-
-  virtual void *announce_indexed_node(
-	int inode,	     
-	const SPApar_pos &pos, 
-	const SPAposition &X, 
-	const SPAunit_vector &N){
+  virtual void announce_indexed_polynode(int ipoly, int i, void *pnode);
+  virtual void *announce_indexed_node(int inode, const SPApar_pos &pos, 
+                                      const SPAposition &X, const SPAunit_vector &N)
+  {
     SPoint2 p(pos.u,pos.v); 
     _current->stl_vertices[inode] = p; 
     //    printf("node %d pos %g %g\n",inode,p.x(),p.y());
     return (void*)inode; // bad idea, but...
   }
-
-  virtual void 	announce_indexed_polynode (ENTITY *E, int ipoly, int i, 
-					   void *id, const double &edge_tpar, 
-					   const SPApar_pos &uv, const SPAposition &iX, const SPAunit_vector &N){
+  virtual void 	announce_indexed_polynode(ENTITY *E, int ipoly, int i, 
+                                          void *id, const double &edge_tpar, 
+                                          const SPApar_pos &uv, const SPAposition &iX,
+                                          const SPAunit_vector &N)
+  {
   }
-
-  virtual void * announce_indexed_polyedge (int ipoly, int i, void *mate){
+  virtual void *announce_indexed_polyedge(int ipoly, int i, void *mate)
+  {
+    return 0;
   }
-  virtual void	start_indexed_polygon(int polygonIndex,int _polygonNodeCount, int ishare = -2){
+  virtual void	start_indexed_polygon(int polygonIndex,int _polygonNodeCount, 
+                                      int ishare = -2)
+  {
   }
-
-  virtual void announce_indexed_polynode(ENTITY *,int,int,void*) {
+  virtual void announce_indexed_polynode(ENTITY *,int,int,void*)
+  {
   }
-  
-  virtual void end_mesh_output(	ENTITY *entity,	ENTITY *app_ref,ENTITY *format){
+  virtual void end_mesh_output(ENTITY *entity,	ENTITY *app_ref,ENTITY *format)
+  {
   }
-  virtual void save_mesh_output(ENTITY *entity,ENTITY *app_ref,ENTITY *format){
+  virtual void save_mesh_output(ENTITY *entity,ENTITY *app_ref,ENTITY *format)
+  {
   }
 };
 
-void GMSH_MESH_MANAGER::announce_indexed_polynode (int ipoly, int i, void *pnode){
-  _current->stl_triangles[ipoly*3+i] = (int)pnode;
+void GMSH_MESH_MANAGER::announce_indexed_polynode (int ipoly, int i, void *pnode)
+{
+  _current->stl_triangles[ipoly*3+i] = (int)(long)pnode;
 }
 
-
-
 class ACIS_Internals {
 public:
   ENTITY_LIST entities;
@@ -169,7 +163,7 @@ void ACIS_Internals::addVertices (GModel *gm, ENTITY_LIST &l)
 {
   l.init();
   ENTITY *e;
-  while(e = l.next()){
+  while((e = l.next())){
     VERTEX *av = dynamic_cast<VERTEX*>(e);
     if (av){
       GVertex *v = getACISVertexByNativePtr(gm, av);
@@ -183,7 +177,7 @@ void ACIS_Internals::addEdges (GModel *gm, ENTITY_LIST &l)
 {
   l.init();
   ENTITY *e;
-  while(e = l.next()){
+  while((e = l.next())){
     EDGE *av = dynamic_cast<EDGE*>(e);
     if (av){
       GEdge *v = getACISEdgeByNativePtr(gm, av);
@@ -201,7 +195,7 @@ void ACIS_Internals::addFaces (GModel *gm, ENTITY_LIST &l)
 {
   l.init();
   ENTITY *e;
-  while(e = l.next()){
+  while((e = l.next())){
     FACE *av = dynamic_cast<FACE*>(e);
     if (av){
       GFace *v = getACISFaceByNativePtr(gm,av);
@@ -228,7 +222,7 @@ void ACIS_Internals::loadSAT(std::string fileName, GModel *gm)
   
   ENTITY *e;
   entities.init();
-  while(e = entities.next()){
+  while((e = entities.next())){
     //    printf("an entity\n");
     if (is_VERTEX(e)){
       //      printf("VERTEX FOUND\n");
diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp
index f91c9873e2c44b9e43afb6d7c1cb1ce94ae39075..8982c70c09ba5f0de3dcff1f34d5c162e7261a1e 100644
--- a/Geo/GModelIO_Mesh.cpp
+++ b/Geo/GModelIO_Mesh.cpp
@@ -150,16 +150,16 @@ static MElement *getParent(int parentNum, int dim,
   case 1 :
     return getParent(parentNum, elements[1]);
   case 2 :
-    if(parent = getParent(parentNum, elements[2])) return parent;
-    if(parent = getParent(parentNum, elements[3])) return parent;
-    if(parent = getParent(parentNum, elements[8])) return parent;
+    if((parent = getParent(parentNum, elements[2]))) return parent;
+    if((parent = getParent(parentNum, elements[3]))) return parent;
+    if((parent = getParent(parentNum, elements[8]))) return parent;
     return parent;
   case 3 :
-    if(parent = getParent(parentNum, elements[4])) return parent;
-    if(parent = getParent(parentNum, elements[5])) return parent;
-    if(parent = getParent(parentNum, elements[6])) return parent;
-    if(parent = getParent(parentNum, elements[7])) return parent;
-    if(parent = getParent(parentNum, elements[9])) return parent;
+    if((parent = getParent(parentNum, elements[4]))) return parent;
+    if((parent = getParent(parentNum, elements[5]))) return parent;
+    if((parent = getParent(parentNum, elements[6]))) return parent;
+    if((parent = getParent(parentNum, elements[7]))) return parent;
+    if((parent = getParent(parentNum, elements[9]))) return parent;
     return parent;
   default : return parent;
   }
@@ -3012,7 +3012,7 @@ GModel *GModel::createGModel(std::map<int, MVertex*> &vertexMap,
   int minVertex = std::numeric_limits<int>::max();
   int num;
 
-  for(it; it != end; ++it){
+  for(; it != end; ++it){
     num = it->first;
     minVertex = std::min(minVertex, num);
     maxVertex = std::max(maxVertex, num);
diff --git a/Geo/GeomMeshMatcher.cpp b/Geo/GeomMeshMatcher.cpp
index de6b3838f696c7d4ed67f39e586cba35aba0280f..2036f402cd159f74df3a94dc8b1fd03a3b20c9ce 100644
--- a/Geo/GeomMeshMatcher.cpp
+++ b/Geo/GeomMeshMatcher.cpp
@@ -93,7 +93,7 @@ GeomMeshMatcher::matchVertices(GModel* m1, GModel *m2, bool& ok)
     int counter2 = 0;
 
     discreteVertex* best_candidate;
-    GEntity* best_candidate_ge;
+    GEntity* best_candidate_ge = 0;
     double best_score = DBL_MAX;
 
     for (std::vector<GEntity*>::iterator entity2 = m2_entities.begin();
@@ -416,7 +416,8 @@ int GeomMeshMatcher:: match(GModel *geom, GModel *mesh)
       std::vector<Pair<GFace*, GFace*> > *coresp_f = matchFaces(geom, mesh, coresp_e,ok);
       if (ok) {
         // This will match REGIONS
-        std::vector<Pair<GRegion*, GRegion*> >* coresp_r = matchRegions(geom, mesh, coresp_f,ok);
+        //std::vector<Pair<GRegion*, GRegion*> >* coresp_r =
+        matchRegions(geom, mesh, coresp_f,ok);
         if (ok) {
           mesh->writeMSH("out.msh",2.0,false,true);
           return 1;
diff --git a/Geo/Homology.cpp b/Geo/Homology.cpp
index 1e20f392c09dd519fd1e610f8b0b08f422d1dd75..b04b8ffe84821abc298a9cf8b9f51550031d5a5c 100644
--- a/Geo/Homology.cpp
+++ b/Geo/Homology.cpp
@@ -380,6 +380,7 @@ void Homology::findHomSequence(){
 
   if(_fileName != "") writeGeneratorsMSH();
   delete cellComplex;
+  delete seq;
 }
 
 std::string Homology::getDomainString(const std::vector<int>& domain,
@@ -595,8 +596,7 @@ int Chain::createPGroup()
     _model->setPhysicalName(getName(), getDim(), physicalNum);
     
     // create PView for visualization
-    PView* chain = new PView(getName(), "ElementData", getGModel(), 
-			     data, 0, 1);
+    new PView(getName(), "ElementData", getGModel(), data, 0, 1);
   }
    
   return physicalNum;
diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp
index 9694b8b6689c7bf2b1241cdbfd6c34ede4ef7543..2ab32d73234366c8f5bdee0c3896cfd41e071a03 100644
--- a/Geo/MElement.cpp
+++ b/Geo/MElement.cpp
@@ -379,7 +379,6 @@ void MElement::movePointFromElementSpaceToParentSpace(double &u, double &v, doub
 {
   if(!getParent()) return;
   SPoint3 p;
-  double uvwE[3] = {u, v, w};
   pnt(u, v, w, p);
   double xyz[3] = {p.x(), p.y(), p.z()};
   double uvwP[3];
diff --git a/Geo/MElementCut.cpp b/Geo/MElementCut.cpp
index e38e0ad9f99babaaf73ad09eaab17cbbc69c2d25..dedd10a21afbf161be2b016146ec90121377b309 100644
--- a/Geo/MElementCut.cpp
+++ b/Geo/MElementCut.cpp
@@ -363,7 +363,8 @@ void MTriangleBorder::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
     const double v = ptsi[ip].pt[1];
     const double w = ptsi[ip].pt[2];
     const double weight = ptsi[ip].weight;
-    const double detJ = tt.getJacobian(u, v, w, jac);
+    //const double detJ = 
+    tt.getJacobian(u, v, w, jac);
     SPoint3 p; tt.pnt(u, v, w, p);
     _intpt[ip].pt[0] = p.x();
     _intpt[ip].pt[1] = p.y();
@@ -404,7 +405,8 @@ void MPolygonBorder::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
     const double v = ptsi[ip].pt[1];
     const double w = ptsi[ip].pt[2];
     const double weight = ptsi[ip].weight;
-    const double detJ = pp.getJacobian(u, v, w, jac);
+    //const double detJ = 
+    pp.getJacobian(u, v, w, jac);
     SPoint3 p; pp.pnt(u, v, w, p);
     _intpt[ip].pt[0] = p.x();
     _intpt[ip].pt[1] = p.y();
@@ -442,7 +444,8 @@ void MLineBorder::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
     const double v = ptsi[ip].pt[1];
     const double w = ptsi[ip].pt[2];
     const double weight = ptsi[ip].weight;
-    const double detJ = ll.getJacobian(u, v, w, jac);
+    //const double detJ =
+    ll.getJacobian(u, v, w, jac);
     SPoint3 p; ll.pnt(u, v, w, p);
     _intpt[ip].pt[0] = p.x();
     _intpt[ip].pt[1] = p.y();
@@ -645,9 +648,7 @@ static void elementCutMesh(MElement *e, std::vector<const gLevelset *> &RPN,
   bool isCut = false;
   unsigned int nbL = lines.size();
   unsigned int nbTr = triangles.size();
-  unsigned int nbQ = quads.size();
   unsigned int nbTe = tetras.size();
-  unsigned int nbH = hexas.size();
 
   MElement *copy = e->copy(numEle, vertexMap, newParents, newDomains);
   MElement *parent = eParent ? copy->getParent() : copy;
diff --git a/Geo/MQuadrangle.h b/Geo/MQuadrangle.h
index 2f6abe5e8f7d932d9330aa97fa5d528ed28a0ea6..6b362d25d1a4949fa400af8465cedb5d9c627e4a 100644
--- a/Geo/MQuadrangle.h
+++ b/Geo/MQuadrangle.h
@@ -345,8 +345,8 @@ class MQuadrangleN : public MQuadrangle {
   virtual MVertex *getVertex(int num){ return num < 4 ? _v[num] : _vs[num - 4]; }
   virtual int getNumFaceVertices() const 
   {
-    if( _order>1 && _vs.size()+4==(_order+1)*(_order+1))
-      return (_order-1)*(_order-1);
+    if(_order > 1 && (int)_vs.size() + 4 == (_order + 1) * (_order + 1))
+      return (_order - 1) * (_order - 1);
     else
       return 0;
   }
diff --git a/Geo/OCCFace.cpp b/Geo/OCCFace.cpp
index 861c60c459103dc9ec3b2d817a81c158a27a3a12..a72342ff450cb597b0469da7e7f437b1de3a7a54 100644
--- a/Geo/OCCFace.cpp
+++ b/Geo/OCCFace.cpp
@@ -435,7 +435,6 @@ void OCCFace::replaceEdgesInternal(std::list<GEdge*> &new_edges)
 	if (bIsUPeriodic) {
 	  Standard_Real aT1, aT2, aTx, aUx;
 	  BRep_Builder aBB_;
-	  double aTwoPI = 2 * M_PI + PI;
 	  Handle(Geom2d_Curve) aC2D =
             BRep_Tool::CurveOnSurface(aER, copy_of_s_forward, aT1, aT2);
 	  if (!aC2D.IsNull()) {
diff --git a/Mesh/highOrderSmoother.cpp b/Mesh/highOrderSmoother.cpp
index d045cfb5e3a1eae6d6840770932da42c12b85c51..dcadba10c29d991fd7fb5d7d6322c4747ffd147d 100644
--- a/Mesh/highOrderSmoother.cpp
+++ b/Mesh/highOrderSmoother.cpp
@@ -362,7 +362,6 @@ void highOrderSmoother::optimize(GFace * gf,
   //  if (gf->geomType() != GEntity::Plane) return;
 
     std::vector<MElement*> bad;
-    int count = 0;
     
 
   while (1) {
@@ -1414,7 +1413,7 @@ static int swapHighOrderTriangles(GFace *gf,
     }
     ++itp;
   }
-  int c1=0,c2=0;
+
   for (unsigned int i = 0; i < gf->mesh_vertices.size(); i++){
     if (v_removed.find(gf->mesh_vertices[i]) == v_removed.end()){
       mesh_vertices2.push_back(gf->mesh_vertices[i]);
diff --git a/Mesh/multiscalePartition.cpp b/Mesh/multiscalePartition.cpp
index 25003d7098e10f822ca168ca17b87f997d23ef55..4d901129d1808cb78352f9f7db7b0988c8a264eb 100644
--- a/Mesh/multiscalePartition.cpp
+++ b/Mesh/multiscalePartition.cpp
@@ -277,7 +277,7 @@ static void printLevel(std::vector<MElement *> &elements, int recur, int region)
     fprintf(fp,"%d %g %g %g\n",(*it)->getIndex(),
             (*it)->x(),(*it)->y(),(*it)->z());
   }
-  fprintf(fp,"$EndNodes\n",elements.size());
+  fprintf(fp,"$EndNodes\n");
   
   fprintf(fp,"$Elements\n%d\n", (int)elements.size());
   for (unsigned int i = 0; i < elements.size(); i++){
@@ -387,7 +387,6 @@ int multiscalePartition::assembleAllPartitions()
     if(iLevel->elements.size() > 0){
       for (unsigned j = 0; j < iLevel->elements.size(); j++){
         MElement *e = iLevel->elements[j];
-        int part = e->getPartition();
         e->setPartition(iPart);
       }
       iPart++;
diff --git a/Numeric/DivideAndConquer.cpp b/Numeric/DivideAndConquer.cpp
index 754152be4ce21b6c0214cae12bd7be09834fe0d0..3375e2102735c9fd26a40eab7729497d5fb5507c 100644
--- a/Numeric/DivideAndConquer.cpp
+++ b/Numeric/DivideAndConquer.cpp
@@ -758,8 +758,8 @@ void DocRecord::RemoveAllDList()
 }
 
 DocRecord::DocRecord(int n) 
-  : numPoints(n), points(NULL), numTriangles(0), triangles(NULL), 
-    _hullSize(0), _hull(NULL), _adjacencies(NULL)
+  : _hullSize(0), _hull(NULL), _adjacencies(NULL),
+    numPoints(n), points(NULL), numTriangles(0), triangles(NULL)
 {
   if(numPoints)
     points = new PointRecord[numPoints];
diff --git a/Numeric/DivideAndConquer.h b/Numeric/DivideAndConquer.h
index b8093c27875ac5e5a26c9765129a07a7a416a267..aa75d2b79e7818500b89e99e6e758176122ba00a 100644
--- a/Numeric/DivideAndConquer.h
+++ b/Numeric/DivideAndConquer.h
@@ -21,11 +21,11 @@ typedef struct{
   double h;
 }DPoint;
 
-struct PointRecord{
+struct PointRecord {
   DPoint where;
   DListPeek adjacent;
   void *data;
-  PointRecord () : data (0) , adjacent(0) {}
+  PointRecord() : adjacent(0), data (0) {}
 };
 
 struct _CDLIST{
@@ -56,7 +56,7 @@ class DocRecord{
  private:
   int _hullSize;
   PointNumero *_hull;
-  STriangle * _adjacencies;
+  STriangle *_adjacencies;
   PointNumero Predecessor(PointNumero a, PointNumero b);
   PointNumero Successor(PointNumero a, PointNumero b);
   int FixFirst(PointNumero x, PointNumero f);
@@ -93,7 +93,7 @@ class DocRecord{
   void MakeMeshWithPoints();
   void Voronoi ();
   int hullSize() {return _hullSize;}
-  int onHull(PointNumero i) {return std::binary_search(_hull, _hull+_hullSize, i);}
+  int onHull(PointNumero i) { return std::binary_search(_hull, _hull+_hullSize, i); }
   void makePosView(std::string);
   double Lloyd (int);
   void voronoiCell (PointNumero pt, std::vector<SPoint2> &pts) const;
diff --git a/Numeric/Numeric.cpp b/Numeric/Numeric.cpp
index 9d5628ffa679f93639df3409bc78ad2fa8f33bf2..f636204b39c611b322346003007ff0c0e28ea72b 100644
--- a/Numeric/Numeric.cpp
+++ b/Numeric/Numeric.cpp
@@ -840,7 +840,7 @@ void signedDistancesPointsTriangle(std::vector<double>&distances,
   for (unsigned int i = 0; i < pts.size(); i++)
     distances[i] = 1.e22;
 
-  if (det = 0.0) return;
+  if(det == 0.0) return;
 
   const double n2t1 = dot(t1, t1);
   const double n2t2 = dot(t2, t2);
diff --git a/Numeric/fullMatrix.cpp b/Numeric/fullMatrix.cpp
index 3927e9af1d5464daaedb61c4f5689bb046fb6a2b..bd4b139e060ae405ed20dc2639b98b285ccbe999 100644
--- a/Numeric/fullMatrix.cpp
+++ b/Numeric/fullMatrix.cpp
@@ -49,18 +49,20 @@ void fullVector<double>::axpy(fullVector<double> &x,double alpha)
 }
 
 template<> 
-void fullMatrix<double>::scale(const double s) {
-  int N = _r*_c;
+void fullMatrix<double>::scale(const double s)
+{
+  int N = _r * _c;
   int stride = 1;
   double ss = s;
   F77NAME(dscal)(&N, &ss,_data, &stride);
 }
 
 template<> 
-void fullMatrix<std::complex<double> >::scale(const double s) {
-  int N = _r*_c;
+void fullMatrix<std::complex<double> >::scale(const double s)
+{
+  int N = _r * _c;
   int stride = 1;
-  std::complex<double> ss = (s,0);
+  std::complex<double> ss(s, 0.);
   F77NAME(zscal)(&N, &ss,_data, &stride);
 }
 
@@ -311,7 +313,9 @@ template<>
 void fullMatrix<double>::registerBindings(binding *b)
 {
   classBinding *cb = b->addClass<fullMatrix<double> >("fullMatrix");
-  cb->setDescription("A full matrix of double-precision floating point numbers. The memory is allocated in one continuous block and stored in column major order (like in fortran).");
+  cb->setDescription("A full matrix of double-precision floating point numbers. "
+                     "The memory is allocated in one continuous block and stored "
+                     "in column major order (like in fortran).");
   methodBinding *cm;
   cm = cb->addMethod("size1", &fullMatrix<double>::size1);
   cm->setDescription("Returns the number of rows in the matrix");
diff --git a/Numeric/polynomialBasis.cpp b/Numeric/polynomialBasis.cpp
index aa9373c9f4d768eb3b01a4386e2927789e9e3064..51c1cdee03e286df4028035e0b38d6f3053b7d23 100644
--- a/Numeric/polynomialBasis.cpp
+++ b/Numeric/polynomialBasis.cpp
@@ -675,8 +675,6 @@ static fullMatrix<double> gmshGeneratePointsQuad(int order, bool serendip)
   int nbPoints = serendip ? order*4 : (order+1)*(order+1);
   fullMatrix<double> point(nbPoints, 2);
 
-  double dd = 1. / order;
-
   if (order > 0) {
     point(0, 0) = -1;
     point(0, 1) = -1;
diff --git a/Plugin/Eigenvectors.cpp b/Plugin/Eigenvectors.cpp
index 0663228db300308007b8e79d3f4e051bf3d45293..2a84e7c954de24eb392bc964e3fb57e70fc63eda 100644
--- a/Plugin/Eigenvectors.cpp
+++ b/Plugin/Eigenvectors.cpp
@@ -44,13 +44,6 @@ StringXNumber *GMSH_EigenvectorsPlugin::getOption(int iopt)
   return &EigenvectorsOptions_Number[iopt];
 }
 
-static int nonzero(double v[3])
-{
-  for(int i = 0; i < 3; i++)
-    if(fabs(v[i]) > 1.e-16) return 1;
-  return 0;
-}
-
 PView *GMSH_EigenvectorsPlugin::execute(PView *v)
 {
   int scale = (int)EigenvectorsOptions_Number[0].def;
diff --git a/Plugin/GSHHS.cpp b/Plugin/GSHHS.cpp
index 2f7be6b6f72aa7c657add7d8d66655edfb083511..8faf29a9e4697d4c5645b988c76ce409257a8e0c 100644
--- a/Plugin/GSHHS.cpp
+++ b/Plugin/GSHHS.cpp
@@ -367,13 +367,13 @@ public:
     box *b;
     double min_dist;
     loop *l;
-    point(double _x,double _y,double _z,Field *f)
+    point(double _x,double _y,double _z,Field *f) : b(0), min_dist(0.), l(0)
     {
       v[0]=_x; v[1]=_y; v[2]=_z;
       if(f)
         min_dist=(*f)(v[0],v[1],v[2]);
     }
-    point(double _x,double _y,double _z,double _min_dist)
+    point(double _x,double _y,double _z,double _min_dist) : b(0), l(0)
     {
       v[0]=_x; v[1]=_y; v[2]=_z;
       min_dist=_min_dist;
diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp
index 8c0fc5b3c7b961cf43abdf73d581663c8cbcf64b..f0ee0db5a5e0ded969047bfa5ba7c04e1c74d62d 100644
--- a/Plugin/Plugin.cpp
+++ b/Plugin/Plugin.cpp
@@ -68,7 +68,8 @@ PView *GMSH_PostPlugin::executeRemote(PView *view)
   }
   
   for(int i = 0; i < getNbOptions(); i++)
-    if(getOption(i)->str == "View") getOption(i)->def = remoteIndex;
+    if(std::string(getOption(i)->str) == "View")
+      getOption(i)->def = remoteIndex;
   
   std::string options = serialize();
   view->getData()->fillRemoteVertexArrays(options);
diff --git a/Post/PViewDataGModel.h b/Post/PViewDataGModel.h
index 75aa808e51feb241e215baab317786b51562e2fb..263ecaef6a8207aa3ef2a44da9b3137c2ffdd3de 100644
--- a/Post/PViewDataGModel.h
+++ b/Post/PViewDataGModel.h
@@ -89,7 +89,7 @@ class stepData{
   int getNumComponents(){ return _numComp; }
   int getMult(int index)
   {
-    if(index < 0 || index >= _mult.size()) return 1;
+    if(index < 0 || index >= (int)_mult.size()) return 1;
     return _mult[index];
   }
   std::string getFileName(){ return _fileName; }
@@ -121,7 +121,7 @@ class stepData{
         for(int i = 0; i < _numComp * mult; i++) (*_data)[index][i] = 0.;
       }
       if(mult > 1){
-        if(index >= _mult.size()) _mult.resize(index + 100, 1); // optimize this
+        if(index >= (int)_mult.size()) _mult.resize(index + 100, 1); // optimize this
         _mult[index] = mult;
       }
     }
diff --git a/Solver/convexCombinationTerm.h b/Solver/convexCombinationTerm.h
index 092bbdfb05cd655d5078b223d8260806d5e3298e..e559fd3e21141e173302c96ed005f4fa66397a71 100644
--- a/Solver/convexCombinationTerm.h
+++ b/Solver/convexCombinationTerm.h
@@ -22,7 +22,7 @@ class convexCombinationTerm : public femTerm<double> {
   const int _iField;
  public:
   convexCombinationTerm(GModel *gm, int iField, simpleFunction<double> *k)
-    : femTerm<double>(gm), _iField(iField), _k(k) {}
+    : femTerm<double>(gm), _k(k), _iField(iField) {}
   virtual int sizeOfR(SElement *se) const
   {
     return se->getMeshElement()->getNumVertices();
diff --git a/Solver/crossConfTerm.h b/Solver/crossConfTerm.h
index 88543de5d34814749a17b8e0c7013bae055a8410..f0dc4ddd80785795b9324474b4b57c267f62287e 100644
--- a/Solver/crossConfTerm.h
+++ b/Solver/crossConfTerm.h
@@ -22,8 +22,8 @@ class crossConfTerm : public femTerm<double> {
  public:
   crossConfTerm(GModel *gm, int iFieldR, int iFieldC, 
                 simpleFunction<double> *diffusivity)
-    : femTerm<double>(gm), _iFieldR(iFieldR), _iFieldC(iFieldC), 
-      _diffusivity(diffusivity) {}
+    : femTerm<double>(gm), _diffusivity(diffusivity), _iFieldR(iFieldR), 
+      _iFieldC(iFieldC) {}
   virtual int sizeOfR(SElement *se) const 
   {
     return se->getMeshElement()->getNumVertices(); 
diff --git a/Solver/diagBCTerm.h b/Solver/diagBCTerm.h
index 322d118513c575aff77b8ca2f0f08d8d0d030770..eaec1127f45d5030f796d0dea8b20f3832cfba5a 100644
--- a/Solver/diagBCTerm.h
+++ b/Solver/diagBCTerm.h
@@ -22,7 +22,7 @@ class diagBCTerm : public femTerm<double> {
   const int _iField;
  public:
   diagBCTerm(GModel *gm, int iField, simpleFunction<double> *k)
-    : femTerm<double>(gm), _iField(iField), _k(k) {}
+    : femTerm<double>(gm), _k(k), _iField(iField) {}
   virtual int sizeOfR(SElement *se) const
   {
     return se->getMeshElement()->getNumVertices();
diff --git a/Solver/helmholtzTerm.h b/Solver/helmholtzTerm.h
index 45f0b9961260f2fdc93570d1b39ffe08f7c624ee..64b6d1890b7764dc9402d7c7b17f9b741f1f0e6a 100644
--- a/Solver/helmholtzTerm.h
+++ b/Solver/helmholtzTerm.h
@@ -25,8 +25,7 @@ class helmholtzTerm : public femTerm<scalar> {
  public:
   helmholtzTerm(GModel *gm, int iFieldR, int iFieldC, simpleFunction<scalar> *k,
                 simpleFunction<scalar> *a) 
-    : femTerm<scalar>(gm), _iFieldR(iFieldR), _iFieldC(iFieldC),
-      _k(k), _a(a) {}
+    : femTerm<scalar>(gm), _k(k), _a(a), _iFieldR(iFieldR), _iFieldC(iFieldC) {}
   // one dof per vertex (nodal fem)
   virtual int sizeOfR(SElement *se) const 
   { 
diff --git a/Solver/linearSystemPETSc.h b/Solver/linearSystemPETSc.h
index 8ccca3e8f4ce760286ee812f0e9c8e98c24708f8..4097a529bd890b96273d76caf3fa7c23b4de437a 100644
--- a/Solver/linearSystemPETSc.h
+++ b/Solver/linearSystemPETSc.h
@@ -156,6 +156,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
     PetscInt its;
     _try(KSPGetIterationNumber(ksp, &its));
     Msg::Info("%d iterations", its);
+    return 1;
   }
   Mat &getMatrix(){ return _a; }
 };
diff --git a/contrib/DiscreteIntegration/Integration3D.cpp b/contrib/DiscreteIntegration/Integration3D.cpp
index 48b7bbf9b166523d40d6e2c914c1b3d2137d7ee1..d4f7d761c01d3cea632430b1ae6a272f734d4186 100644
--- a/contrib/DiscreteIntegration/Integration3D.cpp
+++ b/contrib/DiscreteIntegration/Integration3D.cpp
@@ -442,6 +442,7 @@ int bestQuality (DI_Point *p0, DI_Point *p1, DI_Point *p2,
     *t3 = new DI_Tetra(p1, p5, p3, p4);
     return 6;
   }
+  return 0;
 }
 
 // computes the intersection between a level set and a linear edge
@@ -1037,6 +1038,7 @@ bool DI_ElementLessThan::operator()(const DI_Element *e1, const DI_Element *e2)
     if(e1->z(i) - e2->z(i) >  tolerance) return true;
     return false;
   }
+  return false;
 }
 
 // DI_Line methods --------------------------------------------------------------------------------
diff --git a/contrib/mpeg_encode/bframe.cpp b/contrib/mpeg_encode/bframe.cpp
index 7ac51ff8d75d36781f657dd86033f39c0fd72f35..72eecb2deb496d80801d07cb58f408173753d372 100644
--- a/contrib/mpeg_encode/bframe.cpp
+++ b/contrib/mpeg_encode/bframe.cpp
@@ -541,7 +541,9 @@ GenBFrame(BitBucket *bb,
 	    BlockToData(curr->decoded_cr, dec[5], y>>1, x>>1);
 	  }
 	} else if (dct_data[y][x].useMotion == SKIP) {
-	skip_block:
+#ifdef BUGGY_CODE
+        skip_block:
+#endif
 	  numSkipped++;
 	  mbAddrInc++;
 	      
diff --git a/contrib/mpeg_encode/frame.cpp b/contrib/mpeg_encode/frame.cpp
index c51e074b2179e869aae40eab8408cf7db4dbcf28..2ab775fcc948984606b97a98f7eab77d64c04525 100644
--- a/contrib/mpeg_encode/frame.cpp
+++ b/contrib/mpeg_encode/frame.cpp
@@ -782,7 +782,7 @@ GetNumOfFrames(int *numOfFrames)
     int idx, bcount;
 
     if (stdinUsed) {
-      for ( idx = 0, bcount = 0; idx < strlen(framePattern); idx++) {
+      for ( idx = 0, bcount = 0; idx < (int)strlen(framePattern); idx++) {
 
 	/* counts the maximum number of B frames between two reference
 	 * frames. 
diff --git a/contrib/mpeg_encode/libpnmrw.cpp b/contrib/mpeg_encode/libpnmrw.cpp
index e8de080b4b6fcffddf0fc0435b13d6d923171b5f..bcbd6922efa713d4ec65d105f77d363a9bdb6e9c 100644
--- a/contrib/mpeg_encode/libpnmrw.cpp
+++ b/contrib/mpeg_encode/libpnmrw.cpp
@@ -121,7 +121,7 @@ pm_freearray(char** its, int rows)
 static void
 pm_perror(const char* reason)
 {
-  extern int errno;
+  //extern int errno;
   const char* e;
 
   e = "";
@@ -506,7 +506,7 @@ pgm_readpgmrow( FILE* file, gray* grayrow, int cols, gray maxval, int format )
       break;
 	
     case RPGM_FORMAT:
-      if ( fread( grayrow, 1, cols, file ) != cols )
+      if ( (int)fread( grayrow, 1, cols, file ) != cols )
 	{
 	  (void) fprintf( stderr, "%s: EOF / read error\n", progname );
 	  return -1;
@@ -548,7 +548,7 @@ pgm_writepgmrowraw(FILE* file,
                    int cols,
                    gray maxval)
 {
-  if ( fwrite( grayrow, 1, cols, file ) != cols )
+  if ( (int)fwrite( grayrow, 1, cols, file ) != cols )
     {
       (void) fprintf( stderr, "%s: write error\n", progname );
       return -1;
@@ -653,7 +653,7 @@ static int
       grayrow = pgm_allocrow( 3 * cols );
       if ( grayrow == (gray*) 0 )
 	return -1;
-      if ( fread( grayrow, 1, 3 * cols, file ) != 3 * cols )
+      if ( (int)fread( grayrow, 1, 3 * cols, file ) != 3 * cols )
 	{
 	  (void) fprintf( stderr, "%s: EOF / read error\n", progname );
 	  return -1;
@@ -708,7 +708,7 @@ ppm_writeppmrowraw(FILE* file,
       *gP++ = PPM_GETG( *pP );
       *gP++ = PPM_GETB( *pP );
     }
-  if ( fwrite( grayrow, 1, 3 * cols, file ) != 3 * cols )
+  if ( (int)fwrite( grayrow, 1, 3 * cols, file ) != 3 * cols )
     {
       (void) fprintf( stderr, "%s: write error\n", progname );
       return -1;
diff --git a/contrib/mpeg_encode/mheaders.cpp b/contrib/mpeg_encode/mheaders.cpp
index eec9e1e4d8dd83d0dc5e3d9fff1fc72d980c6fa1..e493db7a32ee53482805fe35d6436c2d801405ec 100644
--- a/contrib/mpeg_encode/mheaders.cpp
+++ b/contrib/mpeg_encode/mheaders.cpp
@@ -659,7 +659,7 @@ Mhead_GenSliceHeader(BitBucket *bbPtr,
     /* Extra bit slice info. */
 
     if (extra_info != NULL) {
-	for (i = 0; i < extra_info_size; i++) {
+      for (i = 0; i < (int)extra_info_size; i++) {
 	    Bitio_Write(bbPtr, 0x01, 1);
 	    Bitio_Write(bbPtr, extra_info[i], 8);
 	}
@@ -739,7 +739,7 @@ if ( addr_incr != 1 )
     GenMBAddrIncr(bbPtr, addr_incr);
 
     /* Determine mb_quant  (true if change in q scale) */
-    if ((q_scale != lastQSSet) && ((mb_pattern != 0) || (mb_intra == TRUE))) {
+    if (((int)q_scale != lastQSSet) && ((mb_pattern != 0) || (mb_intra == TRUE))) {
       mb_quant = TRUE;
       lastQSSet = q_scale;
     } else {
@@ -1113,7 +1113,7 @@ GenPictHead(BitBucket *bbPtr,
     /* Extra bit picture info. */
 
     if (extra_info != NULL) {
-	for (i = 0; i < extra_info_size; i++) {
+      for (i = 0; i < (int)extra_info_size; i++) {
 	    Bitio_Write(bbPtr, 0x01, 1);
 	    Bitio_Write(bbPtr, extra_info[i], 8);
 	}
@@ -1128,7 +1128,7 @@ GenPictHead(BitBucket *bbPtr,
     if (ext_data != NULL) {
 	Bitio_Write(bbPtr, EXT_START_CODE, 32);
 
-	for (i = 0; i < ext_data_size; i++) {
+	for (i = 0; i < (int)ext_data_size; i++) {
 	    Bitio_Write(bbPtr, ext_data[i], 8);
 	}
 	Bitio_BytePad(bbPtr);
@@ -1137,7 +1137,7 @@ GenPictHead(BitBucket *bbPtr,
     if (user_data != NULL) {
 	Bitio_Write(bbPtr, USER_START_CODE, 32);
 
-	for (i = 0; i < user_data_size; i++) {
+	for (i = 0; i < (int)user_data_size; i++) {
 	    Bitio_Write(bbPtr, user_data[i], 8);
 	}
 	Bitio_BytePad(bbPtr);
diff --git a/contrib/mpeg_encode/mpeg.cpp b/contrib/mpeg_encode/mpeg.cpp
index 7b8519645e289d1e3f593bf3bdd3a7c2bb84f116..a9e2f228c9f3fe62030647d5f45e27dd7a26cc7a 100644
--- a/contrib/mpeg_encode/mpeg.cpp
+++ b/contrib/mpeg_encode/mpeg.cpp
@@ -605,7 +605,7 @@ fflush(stdout);
 		userDataSize = 0;
 		goto write;
 	      }
-	    if (fread(userData,1,userDataSize,fp) != userDataSize) {
+              if ((int)fread(userData,1,userDataSize,fp) != userDataSize) {
             fprintf(stderr,"Could not read %d bytes from userdata file-%s.\n",
                     userDataSize,userDataFileName);
             userData = NULL;
@@ -1586,19 +1586,19 @@ ReadDecodedRefFrame(MpegFrame *frame,
     Frame_AllocDecoded(frame, TRUE);
     
     for ( y = 0; y < height; y++ ) {
-      if (fread(frame->decoded_y[y], 1, width, fpointer) != width) {
+      if ((int)fread(frame->decoded_y[y], 1, width, fpointer) != width) {
 	fprintf(stderr, "Could not read enough bytes from %s\n", fileName);
       }
     }
     
     for (y = 0; y < (height >> 1); y++) {			/* U */
-      if (fread(frame->decoded_cb[y], 1, width >> 1, fpointer) != (width>>1)) {
+      if ((int)fread(frame->decoded_cb[y], 1, width >> 1, fpointer) != (width>>1)) {
 	fprintf(stderr, "Could not read enough bytes from %s\n", fileName);
       }
     }
     
     for (y = 0; y < (height >> 1); y++) {			/* V */
-      if (fread(frame->decoded_cr[y], 1, width >> 1, fpointer) != (width>>1)) {
+      if ((int)fread(frame->decoded_cr[y], 1, width >> 1, fpointer) != (width>>1)) {
 	fprintf(stderr, "Could not read enough bytes from %s\n", fileName);
       }
     }
diff --git a/contrib/mpeg_encode/param.cpp b/contrib/mpeg_encode/param.cpp
index db24d4a79beed90bd204ab5132c4cd3672ebf635..c4a3785719aa1dec1ea610600af3d072d26cf856 100644
--- a/contrib/mpeg_encode/param.cpp
+++ b/contrib/mpeg_encode/param.cpp
@@ -319,10 +319,12 @@ ReadParamFile(char *fileName,
   char    input[256];
   char    *charPtr;
   boolean yuvUsed = FALSE;
+  /*
   static const char *optionText[LAST_OPTION+1] = { "GOP_SIZE", "PATTERN", "PIXEL", "PQSCALE",
                                              "OUTPUT", "RANGE", "PSEARCH_ALG", "IQSCALE", "INPUT_DIR",
                                              "INPUT_CONVERT", "INPUT", "BQSCALE", "BASE_FILE_FORMAT",
                                              "SLICES_PER_FRAME", "BSEARCH_ALG", "REFERENCE_FRAME"};
+  */
   register int index;
   register int row, col;
 
@@ -552,7 +554,7 @@ ReadParamFile(char *fileName,
         customQtable = qtable;
         optionSeen[OPTION_IQTABLE] = TRUE;
       } else if ( strncmp(input, "INPUT", 5) == 0 ) { /* handle spaces after input */
-        log(10.0);
+        //log(10.0);
         charPtr = SkipSpacesTabs(&input[5]);
         if ( function == ENCODE_FRAMES && *charPtr==0) {
           ReadInputFileNames(fpointer, "END_INPUT");
diff --git a/contrib/mpeg_encode/readframe.cpp b/contrib/mpeg_encode/readframe.cpp
index b3a7e71eb9739394c3fb036c9f5c37a5d710e39c..88dde8410a3db67b0bb0898590083597a73f89ba 100644
--- a/contrib/mpeg_encode/readframe.cpp
+++ b/contrib/mpeg_encode/readframe.cpp
@@ -685,15 +685,15 @@ ReadPPM(MpegFrame *mf,
     Frame_AllocPPM(mf);
 
     for ( y = 0; y < Fsize_y; y++ ) {
-	safe_fread(mf->ppm_data[y], sizeof(char), 3*Fsize_x, fpointer);
+      safe_fread(mf->ppm_data[y], (int)sizeof(char), 3*Fsize_x, fpointer);
 
 	/* read the leftover stuff on the right side */
-	safe_fread(junk, sizeof(char), 3*(width-Fsize_x), fpointer);
+      safe_fread(junk, (int)sizeof(char), 3*(width-Fsize_x), fpointer);
     }
 
     /* read the leftover stuff to prevent broken pipe */
     for ( y=Fsize_y; y<height; ++y ) {
-      safe_fread(junk, sizeof(char), 3*Fsize_x, fpointer);
+      safe_fread(junk, (int)sizeof(char), 3*Fsize_x, fpointer);
     }
     return TRUE;
 }