diff --git a/3d-viewer/3d_fastmath.h b/3d-viewer/3d_fastmath.h
index 24e5a9f7b4..c11ab22def 100644
--- a/3d-viewer/3d_fastmath.h
+++ b/3d-viewer/3d_fastmath.h
@@ -30,9 +30,9 @@
 #ifndef _3D_FASTMATH_H
 #define _3D_FASTMATH_H
 
-#include <string.h>
-#include <stdint.h>
 #include <cmath>
+#include <cstdint>
+#include <cstring>
 
 
 // Define this flag to use fast math optimizations
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp
index 8291fb82a3..7c821be31a 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp
@@ -68,10 +68,10 @@
 
 #include "cbvh_pbrt.h"
 #include "../../../3d_fastmath.h"
-#include <vector>
-#include <boost/range/algorithm/partition.hpp>
 #include <boost/range/algorithm/nth_element.hpp>
-#include <stdlib.h>
+#include <boost/range/algorithm/partition.hpp>
+#include <cstdlib>
+#include <vector>
 
 #include <stack>
 #include <wx/debug.h>
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.h b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.h
index 798e1a4955..dc739189d1 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.h
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.h
@@ -71,8 +71,8 @@
 #define _CBVH_PBRT_H_
 
 #include "caccelerator.h"
+#include <cstdint>
 #include <list>
-#include <stdint.h>
 
 // Forward Declarations
 struct BVHBuildNode;
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/ccontainer.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/ccontainer.cpp
index 9f23b3803b..d49c6b9ed2 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/ccontainer.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/ccontainer.cpp
@@ -28,7 +28,7 @@
  */
 
 #include "ccontainer.h"
-#include <stdio.h>
+#include <cstdio>
 
 CGENERICCONTAINER::CGENERICCONTAINER()
 {
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.h b/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.h
index d8c845c96b..4f1ce8998e 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.h
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/mortoncodes.h
@@ -32,7 +32,7 @@
 #ifndef _MORTONCODES_H_
 #define _MORTONCODES_H_
 
-#include <stdint.h>
+#include <cstdint>
 
 uint32_t EncodeMorton2( uint32_t x, uint32_t y );
 uint32_t EncodeMorton3( uint32_t x, uint32_t y, uint32_t z );
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp
index a4826d69a7..554a73f923 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp
@@ -30,7 +30,7 @@
 
 #include "ray.h"
 #include "../../3d_fastmath.h"
-#include <stdio.h>
+#include <cstdio>
 #include <wx/debug.h>
 
 #include <cmath>
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.cpp
index e8c9c759d8..391a02e9ee 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.cpp
@@ -28,7 +28,7 @@
  */
 
 #include "cobject2d.h"
-#include <stdio.h>
+#include <cstdio>
 
 
 COBJECT2D_STATS *COBJECT2D_STATS::s_instance = 0;
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.h b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.h
index 5e281fb784..a33762d621 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.h
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cobject2d.h
@@ -31,7 +31,7 @@
 #define _COBJECT2D_H_
 
 #include "cbbox2d.h"
-#include <string.h>
+#include <cstring>
 
 #include <class_board_item.h>
 
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp
index 72d007e621..946d2417dd 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox.cpp
@@ -29,7 +29,7 @@
 #include "3d_fastmath.h"
 
 #include "cbbox.h"
-#include <stdio.h>
+#include <cstdio>
 #include <wx/debug.h>   // For the wxASSERT
 
 
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cobject.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cobject.cpp
index d047060e53..e3a4adbb2f 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cobject.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cobject.cpp
@@ -28,7 +28,7 @@
  */
 
 #include "cobject.h"
-#include <stdio.h>
+#include <cstdio>
 
 
 COBJECT3D_STATS *COBJECT3D_STATS::s_instance = 0;
diff --git a/3d-viewer/3d_rendering/cimage.cpp b/3d-viewer/3d_rendering/cimage.cpp
index d562346d96..8dbe8dc45c 100644
--- a/3d-viewer/3d_rendering/cimage.cpp
+++ b/3d-viewer/3d_rendering/cimage.cpp
@@ -29,7 +29,7 @@
 
 #include "cimage.h"
 #include "buffers_debug.h"
-#include <string.h> // For memcpy
+#include <cstring> // For memcpy
 
 #include <atomic>
 #include <thread>
diff --git a/bitmap2component/bitmap2component.cpp b/bitmap2component/bitmap2component.cpp
index 6fd412baf7..c553d0bb77 100644
--- a/bitmap2component/bitmap2component.cpp
+++ b/bitmap2component/bitmap2component.cpp
@@ -23,12 +23,12 @@
  */
 
 #include <algorithm>    // std::max
+#include <cerrno>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <string>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <vector>
 
 #include <common.h>
diff --git a/common/dialogs/dialog_color_picker.cpp b/common/dialogs/dialog_color_picker.cpp
index b331e6ea03..4f8c47ac8d 100644
--- a/common/dialogs/dialog_color_picker.cpp
+++ b/common/dialogs/dialog_color_picker.cpp
@@ -18,8 +18,8 @@
  */
 
 
-#include "math.h"
 #include "dialog_color_picker.h"
+#include <cmath>
 
 #define ALPHA_MAX 100   // the max value returned by the alpha (opacity) slider
 
diff --git a/common/filter_reader.cpp b/common/filter_reader.cpp
index 30c1d29566..5d143044e2 100644
--- a/common/filter_reader.cpp
+++ b/common/filter_reader.cpp
@@ -23,9 +23,9 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
-#include <string.h>
-#include <richio.h>
+#include <cstring>
 #include <filter_reader.h>
+#include <richio.h>
 
 
 FILTER_READER::FILTER_READER( LINE_READER& aReader ) :
diff --git a/common/geometry/shape_collisions.cpp b/common/geometry/shape_collisions.cpp
index 90d63e866c..98a2857340 100644
--- a/common/geometry/shape_collisions.cpp
+++ b/common/geometry/shape_collisions.cpp
@@ -22,8 +22,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
+#include <cmath>
 #include <math/vector2d.h>
-#include <math.h>
 
 #include <geometry/shape.h>
 #include <geometry/shape_arc.h>
diff --git a/common/getrunningmicrosecs.cpp b/common/getrunningmicrosecs.cpp
index e414028345..779bdc626e 100644
--- a/common/getrunningmicrosecs.cpp
+++ b/common/getrunningmicrosecs.cpp
@@ -45,7 +45,7 @@ unsigned GetRunningMicroSecs()
 
 #elif defined(HAVE_CLOCK_GETTIME)
 
-#include <time.h>
+#include <ctime>
 
 unsigned GetRunningMicroSecs()
 {
diff --git a/common/kicad_curl/kicad_curl_easy.cpp b/common/kicad_curl/kicad_curl_easy.cpp
index 18c6f96e55..3a8945ec11 100644
--- a/common/kicad_curl/kicad_curl_easy.cpp
+++ b/common/kicad_curl/kicad_curl_easy.cpp
@@ -25,11 +25,11 @@
 #include <kicad_curl/kicad_curl.h>
 #include <kicad_curl/kicad_curl_easy.h>
 
+#include <cstdarg>
 #include <cstddef>
 #include <exception>
-#include <stdarg.h>
-#include <sstream>
 #include <ki_exception.h>   // THROW_IO_ERROR
+#include <sstream>
 
 
 static size_t write_callback( void* contents, size_t size, size_t nmemb, void* userp )
diff --git a/common/kiway.cpp b/common/kiway.cpp
index 9094f85542..f0f55e8324 100644
--- a/common/kiway.cpp
+++ b/common/kiway.cpp
@@ -22,7 +22,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
-#include <string.h>
+#include <cstring>
 
 #include <macros.h>
 #include <kiway.h>
diff --git a/common/libeval/grammar.c b/common/libeval/grammar.c
index 47c649a14b..3a74c3e28d 100644
--- a/common/libeval/grammar.c
+++ b/common/libeval/grammar.c
@@ -3,10 +3,10 @@
 */
 /* First off, code is included that follows the "include" declaration
 ** in the input grammar file. */
-#include <stdio.h>
+#include <cstdio>
 #line 28 "grammar.lemon"
 
-#include <assert.h>
+#include <cassert>
 #include <libeval/numeric_evaluator.h>
 #line 12 "grammar.c"
 /* Next is all token values, in a form suitable for use by makeheaders.
@@ -236,7 +236,7 @@ struct yyParser {
 typedef struct yyParser yyParser;
 
 #ifndef NDEBUG
-#include <stdio.h>
+#include <cstdio>
 static FILE *yyTraceFILE = 0;
 static char *yyTracePrompt = 0;
 #endif /* NDEBUG */
diff --git a/common/lset.cpp b/common/lset.cpp
index e568c6fe28..a332f0180f 100644
--- a/common/lset.cpp
+++ b/common/lset.cpp
@@ -23,8 +23,8 @@
  */
 
 
-#include <stdarg.h>
-#include <assert.h>
+#include <cassert>
+#include <cstdarg>
 
 #include <layers_id_colors_and_visibility.h>
 #include <class_board.h>
diff --git a/common/ptree.cpp b/common/ptree.cpp
index b8c82988cc..b1619de092 100644
--- a/common/ptree.cpp
+++ b/common/ptree.cpp
@@ -29,7 +29,7 @@
 
 #include <boost/property_tree/ptree.hpp>
 
-#include <assert.h>
+#include <cassert>
 #include <ptree.h>
 
 typedef PTREE::const_iterator           CITER;
diff --git a/common/system/libcontext.cpp b/common/system/libcontext.cpp
index a8ca3434ad..5b3c358f03 100644
--- a/common/system/libcontext.cpp
+++ b/common/system/libcontext.cpp
@@ -13,8 +13,8 @@
             http://www.boost.org/LICENSE_1_0.txt)
 
 */
-#include <stdlib.h>
-#include <setjmp.h>
+#include <csetjmp>
+#include <cstdlib>
 #include <system/libcontext.h>
 
 #if defined(LIBCONTEXT_PLATFORM_windows_i386) && defined(LIBCONTEXT_COMPILER_gcc)
diff --git a/common/utf8.cpp b/common/utf8.cpp
index 2d23e78146..c9a2e60d1b 100644
--- a/common/utf8.cpp
+++ b/common/utf8.cpp
@@ -33,7 +33,7 @@
 #include <richio.h>
 */
 
-#include <assert.h>
+#include <cassert>
 
 
 /*
diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp
index 407e1398b0..5c3a2b8900 100644
--- a/eeschema/sch_legacy_plugin.cpp
+++ b/eeschema/sch_legacy_plugin.cpp
@@ -20,9 +20,9 @@
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <ctype.h>
 #include <algorithm>
 #include <boost/algorithm/string/join.hpp>
+#include <cctype>
 
 #include <wx/mstream.h>
 #include <wx/filename.h>
diff --git a/include/dlist.h b/include/dlist.h
index fb0cf04108..d35b314f74 100644
--- a/include/dlist.h
+++ b/include/dlist.h
@@ -27,7 +27,7 @@
 #define DLIST_H_
 
 
-#include <stdio.h>          // NULL definition.
+#include <cstdio>          // NULL definition.
 
 
 class EDA_ITEM;
diff --git a/include/dsnlexer.h b/include/dsnlexer.h
index 62ab9784d5..0f76bd51fe 100644
--- a/include/dsnlexer.h
+++ b/include/dsnlexer.h
@@ -25,10 +25,10 @@
 #ifndef DSNLEXER_H_
 #define DSNLEXER_H_
 
-#include <stdio.h>
+#include <cstdio>
+#include <hashtables.h>
 #include <string>
 #include <vector>
-#include <hashtables.h>
 
 #include <richio.h>
 
diff --git a/include/eagle_parser.h b/include/eagle_parser.h
index d5a023853c..a5520c9954 100644
--- a/include/eagle_parser.h
+++ b/include/eagle_parser.h
@@ -28,7 +28,7 @@
 #ifndef _EAGLE_PARSER_H_
 #define _EAGLE_PARSER_H_
 
-#include <errno.h>
+#include <cerrno>
 #include <unordered_map>
 
 #include <wx/xml/xml.h>
diff --git a/include/geometry/rtree.h b/include/geometry/rtree.h
index d48d5f5753..423570bfe7 100644
--- a/include/geometry/rtree.h
+++ b/include/geometry/rtree.h
@@ -25,10 +25,10 @@
 // NOTE This file compiles under MSVC 6 SP5 and MSVC .Net 2003 it may not work on other compilers without modification.
 
 // NOTE These next few lines may be win32 specific, you may need to modify them to compile on other platform
-#include <stdio.h>
-#include <math.h>
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
 
 #include <algorithm>
 #include <functional>
diff --git a/include/libeval/numeric_evaluator.h b/include/libeval/numeric_evaluator.h
index a28d541b45..0b46dba244 100644
--- a/include/libeval/numeric_evaluator.h
+++ b/include/libeval/numeric_evaluator.h
@@ -67,10 +67,9 @@ Supported units are millimeters (mm), Mil (mil) and inch (")
 #ifndef NUMERIC_EVALUATOR_H_
 #define NUMERIC_EVALUATOR_H_
 
-#include <stddef.h>
-#include <string>
-#include <string>
+#include <cstddef>
 #include <map>
+#include <string>
 
 #include <base_units.h>
 
diff --git a/include/math/math_util.h b/include/math/math_util.h
index 1bf61fae63..197d41514a 100644
--- a/include/math/math_util.h
+++ b/include/math/math_util.h
@@ -26,7 +26,7 @@
 #ifndef __MATH_UTIL_H
 #define __MATH_UTIL_H
 
-#include <stdint.h>
+#include <cstdint>
 
 /**
  * Function rescale()
diff --git a/include/richio.h b/include/richio.h
index 427a35650a..521b513eb8 100644
--- a/include/richio.h
+++ b/include/richio.h
@@ -34,8 +34,8 @@
 
 // I really did not want to be dependent on wxWidgets in richio
 // but the errorText needs to be wide char so wxString rules.
+#include <cstdio>
 #include <wx/wx.h>
-#include <stdio.h>
 
 #include <ki_exception.h>
 
diff --git a/include/system/libcontext.h b/include/system/libcontext.h
index 645d38ebbe..2154f84a2e 100644
--- a/include/system/libcontext.h
+++ b/include/system/libcontext.h
@@ -17,9 +17,9 @@
 #ifndef __LIBCONTEXT_H
 #define __LIBCONTEXT_H
 
-#include <stdint.h>
-#include <stdio.h>
-#include <stddef.h>
+#include <cstddef>
+#include <cstdint>
+#include <cstdio>
 
 
 #if defined(__GNUC__) || defined(__APPLE__) || defined(__FreeBSD__)
diff --git a/include/trigo.h b/include/trigo.h
index 22dbf64668..8f4713641b 100644
--- a/include/trigo.h
+++ b/include/trigo.h
@@ -28,9 +28,9 @@
  * @file trigo.h
  */
 
-#include <math.h>
-#include <wx/gdicmn.h> // For wxPoint
+#include <cmath>
 #include <math/vector2d.h>
+#include <wx/gdicmn.h> // For wxPoint
 
 /**
  * Function IsPointOnSegment
diff --git a/libs/sexpr/sexpr_parser.cpp b/libs/sexpr/sexpr_parser.cpp
index 28fcd73464..62586acd5a 100644
--- a/libs/sexpr/sexpr_parser.cpp
+++ b/libs/sexpr/sexpr_parser.cpp
@@ -19,9 +19,9 @@
 #include "sexpr/sexpr_parser.h"
 #include "sexpr/sexpr_exception.h"
 #include <cctype>
+#include <cstdlib>     /* strtod */
 #include <iterator>
 #include <stdexcept>
-#include <stdlib.h>     /* strtod */
 
 #include <fstream>
 #include <streambuf>
diff --git a/pagelayout_editor/pl_editor_layout.cpp b/pagelayout_editor/pl_editor_layout.cpp
index aee4530b5c..5ce16dadc2 100644
--- a/pagelayout_editor/pl_editor_layout.cpp
+++ b/pagelayout_editor/pl_editor_layout.cpp
@@ -26,8 +26,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
-#include <limits.h>
 #include <algorithm>
+#include <climits>
 
 #include <fctsys.h>
 #include <common.h>
diff --git a/pcb_calculator/transline/c_microstrip.cpp b/pcb_calculator/transline/c_microstrip.cpp
index 9841322270..a21800ab3f 100644
--- a/pcb_calculator/transline/c_microstrip.cpp
+++ b/pcb_calculator/transline/c_microstrip.cpp
@@ -26,10 +26,10 @@
  * Based on the original microstrip.c by Gopal Narayanan
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcb_calculator/transline/coax.cpp b/pcb_calculator/transline/coax.cpp
index 626753d1ff..94bda6347d 100644
--- a/pcb_calculator/transline/coax.cpp
+++ b/pcb_calculator/transline/coax.cpp
@@ -29,10 +29,10 @@
  */
 
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcb_calculator/transline/coplanar.cpp b/pcb_calculator/transline/coplanar.cpp
index 14a6d12436..819a68dc6c 100644
--- a/pcb_calculator/transline/coplanar.cpp
+++ b/pcb_calculator/transline/coplanar.cpp
@@ -23,10 +23,10 @@
  */
 
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcb_calculator/transline/microstrip.cpp b/pcb_calculator/transline/microstrip.cpp
index 2bd81fe525..bbd01707a6 100644
--- a/pcb_calculator/transline/microstrip.cpp
+++ b/pcb_calculator/transline/microstrip.cpp
@@ -29,10 +29,10 @@
  * Based on the original microstrip.c by Gopal Narayanan
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcb_calculator/transline/rectwaveguide.cpp b/pcb_calculator/transline/rectwaveguide.cpp
index 6965991b80..6fde759e40 100644
--- a/pcb_calculator/transline/rectwaveguide.cpp
+++ b/pcb_calculator/transline/rectwaveguide.cpp
@@ -21,9 +21,9 @@
  *
  */
 
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcb_calculator/transline/stripline.cpp b/pcb_calculator/transline/stripline.cpp
index 5ff0bbeb5b..0074fadff3 100644
--- a/pcb_calculator/transline/stripline.cpp
+++ b/pcb_calculator/transline/stripline.cpp
@@ -22,10 +22,10 @@
  */
 
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcb_calculator/transline/transline.cpp b/pcb_calculator/transline/transline.cpp
index c754f32deb..0d57f7b2ee 100644
--- a/pcb_calculator/transline/transline.cpp
+++ b/pcb_calculator/transline/transline.cpp
@@ -118,7 +118,7 @@ double TRANSLINE::getProperty( enum PRMS_ID aPrmId )
 /*
  * skin_depth - calculate skin depth
  */
-#include <stdio.h>
+#include <cstdio>
 double TRANSLINE::skin_depth()
 {
     double depth;
diff --git a/pcb_calculator/transline/twistedpair.cpp b/pcb_calculator/transline/twistedpair.cpp
index ab41eb5cb0..b6ab6ee006 100644
--- a/pcb_calculator/transline/twistedpair.cpp
+++ b/pcb_calculator/transline/twistedpair.cpp
@@ -22,10 +22,10 @@
  */
 
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 
 #include <units.h>
 #include <transline.h>
diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp
index 1184abdba0..a439593b31 100644
--- a/pcbnew/class_edge_mod.cpp
+++ b/pcbnew/class_edge_mod.cpp
@@ -50,7 +50,7 @@
 
 #include <view/view.h>
 
-#include <stdio.h>
+#include <cstdio>
 
 EDGE_MODULE::EDGE_MODULE( MODULE* parent, STROKE_T aShape ) :
     DRAWSEGMENT( parent, PCB_MODULE_EDGE_T )
diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp
index e773778cdf..436a44acb4 100644
--- a/pcbnew/eagle_plugin.cpp
+++ b/pcbnew/eagle_plugin.cpp
@@ -50,7 +50,7 @@ Load() TODO's
 
 */
 
-#include <errno.h>
+#include <cerrno>
 
 #include <wx/string.h>
 #include <wx/xml/xml.h>
diff --git a/pcbnew/import_gfx/nanosvg.cpp b/pcbnew/import_gfx/nanosvg.cpp
index 438467bf4e..607b6b8120 100644
--- a/pcbnew/import_gfx/nanosvg.cpp
+++ b/pcbnew/import_gfx/nanosvg.cpp
@@ -28,9 +28,9 @@
 
 #include "nanosvg.h"
 
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
 
 #define NSVG_PI             (3.14159265358979323846264338327f)
 #define NSVG_KAPPA90        (0.5522847493f) // Length proportional to radius of a cubic bezier handle for 90deg arcs.
diff --git a/pcbnew/import_gfx/nanosvg.h b/pcbnew/import_gfx/nanosvg.h
index 04f05f9342..a6a659bccd 100644
--- a/pcbnew/import_gfx/nanosvg.h
+++ b/pcbnew/import_gfx/nanosvg.h
@@ -66,7 +66,7 @@
 	nsvgDelete(image);
 */
 
-#include <stdio.h>
+#include <cstdio>
 
 enum NSVGpaintType {
 	NSVG_PAINT_NONE = 0,
diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp
index bdb3762292..7d17e543c2 100644
--- a/pcbnew/legacy_plugin.cpp
+++ b/pcbnew/legacy_plugin.cpp
@@ -58,13 +58,13 @@
 */
 
 
+#include <cerrno>
 #include <cmath>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
+#include <cstdio>
+#include <cstring>
+#include <legacy_plugin.h>   // implement this here
 #include <wx/ffile.h>
 #include <wx/string.h>
-#include <legacy_plugin.h>   // implement this here
 
 #include <kicad_string.h>
 #include <macros.h>
diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp
index 78338ef9e0..813fb23eef 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp
@@ -27,7 +27,7 @@
  * @brief Pcbnew PLUGIN for P-Cad 200x ASCII *.pcb format.
  */
 
-#include <errno.h>
+#include <cerrno>
 
 #include <wx/string.h>
 #include <wx/filename.h>
diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp
index 5c3d81022a..f589619bcc 100644
--- a/pcbnew/pcb_parser.cpp
+++ b/pcbnew/pcb_parser.cpp
@@ -27,12 +27,12 @@
  * @brief Pcbnew s-expression file format parser implementation.
  */
 
-#include <errno.h>
+#include <cerrno>
 #include <common.h>
 #include <confirm.h>
 #include <macros.h>
-#include <trigo.h>
 #include <title_block.h>
+#include <trigo.h>
 
 #include <class_board.h>
 #include <class_dimension.h>
diff --git a/pcbnew/router/time_limit.h b/pcbnew/router/time_limit.h
index 447f074241..b5107624d3 100644
--- a/pcbnew/router/time_limit.h
+++ b/pcbnew/router/time_limit.h
@@ -22,7 +22,7 @@
 #ifndef __TIME_LIMIT_H
 #define __TIME_LIMIT_H
 
-#include <stdint.h>
+#include <cstdint>
 
 namespace PNS {
 
diff --git a/pcbnew/swig/pcbnew_action_plugins.cpp b/pcbnew/swig/pcbnew_action_plugins.cpp
index de90457892..0ea1132200 100644
--- a/pcbnew/swig/pcbnew_action_plugins.cpp
+++ b/pcbnew/swig/pcbnew_action_plugins.cpp
@@ -27,17 +27,17 @@
  */
 
 #include "pcbnew_action_plugins.h"
-#include <python_scripting.h>
-#include <stdio.h>
-#include <macros.h>
-#include <pcbnew_id.h>
-#include <menus_helpers.h>
+#include <board_commit.h>
 #include <class_board.h>
+#include <class_drawsegment.h>
 #include <class_module.h>
 #include <class_track.h>
-#include <class_drawsegment.h>
 #include <class_zone.h>
-#include <board_commit.h>
+#include <cstdio>
+#include <macros.h>
+#include <menus_helpers.h>
+#include <pcbnew_id.h>
+#include <python_scripting.h>
 #include <tool/action_menu.h>
 #include <tool/action_toolbar.h>
 
diff --git a/pcbnew/swig/pcbnew_footprint_wizards.cpp b/pcbnew/swig/pcbnew_footprint_wizards.cpp
index fbc11347fb..20e2005e40 100644
--- a/pcbnew/swig/pcbnew_footprint_wizards.cpp
+++ b/pcbnew/swig/pcbnew_footprint_wizards.cpp
@@ -28,9 +28,9 @@
  */
 
 #include "pcbnew_footprint_wizards.h"
-#include <python_scripting.h>
-#include <stdio.h>
+#include <cstdio>
 #include <macros.h>
+#include <python_scripting.h>
 
 
 PYTHON_FOOTPRINT_WIZARD::PYTHON_FOOTPRINT_WIZARD( PyObject* aWizard )
diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp
index 2a9f97f9b0..4339e61bd2 100644
--- a/pcbnew/swig/pcbnew_scripting_helpers.cpp
+++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp
@@ -30,17 +30,17 @@
 #include <Python.h>
 #undef HAVE_CLOCK_GETTIME  // macro is defined in Python.h and causes redefine warning
 
-#include <pcbnew_scripting_helpers.h>
-#include <pcbnew.h>
-#include <pcbnew_id.h>
+#include <action_plugin.h>
 #include <build_version.h>
 #include <class_board.h>
-#include <kicad_string.h>
+#include <cstdlib>
 #include <io_mgr.h>
+#include <kicad_string.h>
 #include <macros.h>
-#include <stdlib.h>
 #include <pcb_draw_panel_gal.h>
-#include <action_plugin.h>
+#include <pcbnew.h>
+#include <pcbnew_id.h>
+#include <pcbnew_scripting_helpers.h>
 
 static PCB_EDIT_FRAME* s_PcbEditFrame = NULL;
 
diff --git a/pcbnew/swig/python_scripting.cpp b/pcbnew/swig/python_scripting.cpp
index 3cbb342f0a..aef4076e3a 100644
--- a/pcbnew/swig/python_scripting.cpp
+++ b/pcbnew/swig/python_scripting.cpp
@@ -27,9 +27,9 @@
  * @brief methods to add scripting capabilities inside pcbnew
  */
 
+#include <cstdlib>
+#include <cstring>
 #include <python_scripting.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sstream>
 
 #include <fctsys.h>
diff --git a/plugins/3d/vrml/vrml.cpp b/plugins/3d/vrml/vrml.cpp
index c2e2ab5d76..8c227f8255 100644
--- a/plugins/3d/vrml/vrml.cpp
+++ b/plugins/3d/vrml/vrml.cpp
@@ -31,16 +31,16 @@
  *  #VRML V2.0 utf8
  */
 
-#include <locale.h>
-#include <wx/log.h>
-#include <wx/filename.h>
-#include "richio.h"
 #include "plugins/3d/3d_plugin.h"
 #include "plugins/3dapi/ifsg_all.h"
-#include "wrlproc.h"
+#include "richio.h"
 #include "vrml1_base.h"
 #include "vrml2_base.h"
+#include "wrlproc.h"
 #include "x3d.h"
+#include <clocale>
+#include <wx/filename.h>
+#include <wx/log.h>
 
 
 #define PLUGIN_VRML_MAJOR 1
diff --git a/qa/common/geometry/geom_test_utils.h b/qa/common/geometry/geom_test_utils.h
index b5024062f0..afb7f7e9c9 100644
--- a/qa/common/geometry/geom_test_utils.h
+++ b/qa/common/geometry/geom_test_utils.h
@@ -24,7 +24,7 @@
 #ifndef GEOM_TEST_UTILS_H
 #define GEOM_TEST_UTILS_H
 
-#include <math.h>
+#include <cmath>
 
 #include <geometry/seg.h>
 #include <geometry/shape_line_chain.h>
diff --git a/utils/kicad2step/pcb/kicadcurve.cpp b/utils/kicad2step/pcb/kicadcurve.cpp
index debbea3ced..fab98d8b6a 100644
--- a/utils/kicad2step/pcb/kicadcurve.cpp
+++ b/utils/kicad2step/pcb/kicadcurve.cpp
@@ -27,8 +27,8 @@
 
 #include <wx/log.h>
 
+#include <cmath>
 #include <iostream>
-#include <math.h>
 #include <sstream>