From dad398b4437e937d222bafff987814b8f2d80409 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 9 Jan 2016 23:58:09 +0100 Subject: [PATCH] compile with -Wmissing-declarations to catch more errors --- src/mc/mc_base.h | 4 ++++ src/mc/mc_smx.h | 2 -- src/simix/ThreadContext.cpp | 1 + src/simix/UContext.cpp | 6 +++--- src/surf/surf_routing_cluster_fat_tree.cpp | 3 ++- src/surf/surf_routing_cluster_torus.cpp | 3 ++- src/surf/surf_routing_dijkstra.cpp | 5 +++-- src/surf/surf_routing_floyd.cpp | 5 +++-- src/surf/surf_routing_full.cpp | 5 +++-- src/surf/surf_routing_none.cpp | 3 ++- tools/cmake/GCCFlags.cmake | 2 +- 11 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/mc/mc_base.h b/src/mc/mc_base.h index 5b50e147d2..fa1fca1b51 100644 --- a/src/mc/mc_base.h +++ b/src/mc/mc_base.h @@ -12,6 +12,7 @@ #include "simgrid_config.h" #include "src/internal_config.h" #include "src/simix/smx_private.h" +#include "mc/mc.h" SG_BEGIN_DECL() @@ -37,6 +38,9 @@ XBT_PRIVATE void MC_wait_for_requests(void); XBT_PRIVATE extern double *mc_time; +/** Execute a given simcall */ +XBT_PRIVATE void MC_simcall_handle(smx_simcall_t req, int value); + SG_END_DECL() #endif diff --git a/src/mc/mc_smx.h b/src/mc/mc_smx.h index 0b8f9cd66c..7de26cfa74 100644 --- a/src/mc/mc_smx.h +++ b/src/mc/mc_smx.h @@ -84,8 +84,6 @@ XBT_PRIVATE const char* MC_smx_process_get_host_name(smx_process_t p); } \ } -/** Execute a given simcall */ -XBT_PRIVATE void MC_simcall_handle(smx_simcall_t req, int value); XBT_PRIVATE int MC_smpi_process_count(void); diff --git a/src/simix/ThreadContext.cpp b/src/simix/ThreadContext.cpp index e676dc4ef2..c3a3c0099d 100644 --- a/src/simix/ThreadContext.cpp +++ b/src/simix/ThreadContext.cpp @@ -14,6 +14,7 @@ #include "xbt/xbt_os_thread.h" #include "src/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */ +#include "src/simix/smx_private.hpp" #include "src/simix/ThreadContext.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context); diff --git a/src/simix/UContext.cpp b/src/simix/UContext.cpp index af244c1872..5b793c5883 100644 --- a/src/simix/UContext.cpp +++ b/src/simix/UContext.cpp @@ -11,8 +11,8 @@ #include #include "xbt/parmap.h" -#include "smx_private.h" -#include "smx_private.hpp" +#include "src/simix/smx_private.h" +#include "src/simix/smx_private.hpp" #include "src/internal_config.h" #include "src/context_sysv_config.h" /* loads context system definitions */ #include "mc/mc.h" @@ -36,7 +36,7 @@ * Makecontext expects integer arguments, we the context * variable is decomposed into a serie of integers and * each integer is passed as argument to makecontext. */ -XBT_PRIVATE +static void simgrid_makecontext(ucontext_t* ucp, void (*func)(int first, ...), void* arg) { int ctx_addr[CTX_ADDR_LEN]; diff --git a/src/surf/surf_routing_cluster_fat_tree.cpp b/src/surf/surf_routing_cluster_fat_tree.cpp index 7667c22bfd..041abb77bb 100644 --- a/src/surf/surf_routing_cluster_fat_tree.cpp +++ b/src/surf/surf_routing_cluster_fat_tree.cpp @@ -6,7 +6,8 @@ #include #include -#include "surf_routing_cluster_fat_tree.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_cluster_fat_tree.hpp" #include "xbt/lib.h" #include diff --git a/src/surf/surf_routing_cluster_torus.cpp b/src/surf/surf_routing_cluster_torus.cpp index ccbd304ba7..e09daf11d1 100644 --- a/src/surf/surf_routing_cluster_torus.cpp +++ b/src/surf/surf_routing_cluster_torus.cpp @@ -4,7 +4,8 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "surf_routing_cluster_torus.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_cluster_torus.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf"); diff --git a/src/surf/surf_routing_dijkstra.cpp b/src/surf/surf_routing_dijkstra.cpp index 31d603f11f..62776a1bd4 100644 --- a/src/surf/surf_routing_dijkstra.cpp +++ b/src/surf/surf_routing_dijkstra.cpp @@ -4,8 +4,9 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "surf_routing_dijkstra.hpp" -#include "network_interface.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_dijkstra.hpp" +#include "src/surf/network_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic"); diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index 58f4824eb4..b8674c0a42 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -4,8 +4,9 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "surf_routing_floyd.hpp" -#include "network_interface.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_floyd.hpp" +#include "src/surf/network_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf"); diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 20e077678e..cf8fc2b14c 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -4,8 +4,9 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "surf_routing_full.hpp" -#include "network_interface.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_full.hpp" +#include "src/surf/network_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); diff --git a/src/surf/surf_routing_none.cpp b/src/surf/surf_routing_none.cpp index 28c64fb237..2ea5660cca 100644 --- a/src/surf/surf_routing_none.cpp +++ b/src/surf/surf_routing_none.cpp @@ -4,7 +4,8 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "surf_routing_none.hpp" +#include "src/surf/surf_routing_private.hpp" +#include "src/surf/surf_routing_none.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf"); diff --git a/tools/cmake/GCCFlags.cmake b/tools/cmake/GCCFlags.cmake index c1e6abec94..18d8177ba0 100644 --- a/tools/cmake/GCCFlags.cmake +++ b/tools/cmake/GCCFlags.cmake @@ -20,7 +20,7 @@ if(enable_compile_warnings) set(warnCFLAGS "${warnCFLAGS}-Wclobbered -Wno-error=clobbered -Wno-unused-local-typedefs") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wunused -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror") if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wclobbered -Wno-error=clobbered -Wno-unused-local-typedefs") endif() -- 2.20.1