Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Unused parameters argc/argv.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 3 Jun 2019 09:44:08 +0000 (11:44 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 3 Jun 2019 11:23:46 +0000 (13:23 +0200)
39 files changed:
examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c
examples/deprecated/msg/energy-vm/energy-vm.c
examples/deprecated/msg/mc/bugged1.c
examples/deprecated/msg/mc/bugged1_liveness.c
examples/deprecated/msg/mc/bugged2.c
examples/deprecated/msg/mc/bugged2_liveness.c
examples/deprecated/msg/mc/bugged3.c
examples/deprecated/msg/mc/centralized_mutex.c
examples/deprecated/msg/mc/electric_fence.c
examples/deprecated/msg/platform-failures/platform-failures.c
examples/deprecated/msg/process-create/process-create.c
examples/deprecated/msg/trace-categories/trace-categories.c
examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c
examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c
examples/deprecated/msg/trace-masterworker/trace-masterworker.c
examples/deprecated/msg/trace-process-migration/trace-process-migration.c
examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c
examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/mutex-handling/mutex-handling.c
teshsuite/mc/random-bug/random-bug.c
teshsuite/msg/app-token-ring/app-token-ring.c
teshsuite/msg/cloud-capping/cloud-capping.c
teshsuite/msg/cloud-migration/cloud-migration.c
teshsuite/msg/cloud-simple/cloud-simple.c
teshsuite/msg/energy-consumption/energy-consumption.c
teshsuite/msg/energy-pstate/energy-pstate.c
teshsuite/msg/get_sender/get_sender.c
teshsuite/msg/host_on_off/host_on_off.c
teshsuite/msg/host_on_off_recv/host_on_off_recv.c
teshsuite/msg/io-file/io-file.c
teshsuite/msg/plugin-hostload/plugin-hostload.c
teshsuite/msg/process-daemon/process-daemon.c
teshsuite/msg/process-join/process-join.c
teshsuite/msg/process-lifetime/process-lifetime.c
teshsuite/msg/process-migration/process-migration.c
teshsuite/msg/process-suspend/process-suspend.c
teshsuite/msg/task-priority/task-priority.c
teshsuite/msg/task_listen_from/task_listen_from.cpp

index f9d1ed1..cb9bfb5 100644 (file)
@@ -37,7 +37,7 @@ static void send_tasks(int nb_workers)
   }
 }
 
-static int worker_fun(int argc, char *argv[])
+static int worker_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   const char *pr_name = MSG_process_get_name(MSG_process_self());
   char mbox[MAXMBOXLEN];
@@ -65,7 +65,7 @@ static int worker_fun(int argc, char *argv[])
   return 0;
 }
 
-static int master_fun(int argc, char *argv[])
+static int master_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_vm_t vm;
   unsigned int i;
index e4c8ce9..1f35d8b 100644 (file)
@@ -9,7 +9,8 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(energy_vm, "Messages of this example");
 
-static int worker_func(int argc, char *argv[]) {
+static int worker_func(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+{
   msg_task_t task1 = MSG_task_create("t1", 300E6, 0, NULL);
   MSG_task_execute (task1);
   MSG_task_destroy(task1);
@@ -17,7 +18,7 @@ static int worker_func(int argc, char *argv[]) {
   return 0;
 }
 
-static int dvfs(int argc, char *argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t host1 = MSG_host_by_name("MyHost1");
   msg_host_t host2 = MSG_host_by_name("MyHost2");
index b4454fe..0390959 100644 (file)
@@ -15,7 +15,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
   int count = 0;
@@ -36,6 +36,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task =  MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ , NULL /*arbitrary data */ );
 
   MSG_task_send(task, "mymailbox");
index 95880eb..8fd8490 100644 (file)
@@ -34,7 +34,7 @@ static void garbage_stack(void) {
 }
 #endif
 
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int CS_used          = 0;
   msg_task_t task      = NULL;
@@ -84,6 +84,7 @@ static int coordinator(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   int my_pid = MSG_process_get_PID(MSG_process_self());
 
   char *my_mailbox = xbt_strdup(argv[1]);
index c659568..aaf1dc1 100644 (file)
@@ -14,7 +14,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -49,6 +49,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
   msg_task_t task2 = MSG_task_create(argv[1], 0, 10000, NULL);
 
index 19c5740..2b68854 100644 (file)
@@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
 
 int cs = 0;
 
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int CS_used = 0;              // initially the CS is idle
 
@@ -49,6 +49,7 @@ static int coordinator(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   int my_pid = MSG_process_get_PID(MSG_process_self());
   char *my_mailbox = xbt_strdup(argv[1]);
 
index 3546021..c223704 100644 (file)
@@ -17,8 +17,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "this example");
 
-
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -39,6 +38,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
 
   char *mbox = bprintf("mymailbox%s", argv[1]);
index 771cd46..bf21be1 100644 (file)
@@ -16,7 +16,7 @@
 #define CS_PER_PROCESS 2
 XBT_LOG_NEW_DEFAULT_CATEGORY(centralized, "my log messages");
 
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   xbt_dynar_t requests = xbt_dynar_new(sizeof(char *), NULL);   // dynamic vector storing requests (which are char*)
   int CS_used = 0;              // initially the CS is idle
@@ -55,7 +55,7 @@ static int coordinator(int argc, char *argv[])
   return 0;
 }
 
-static int client(int argc, char *argv[])
+static int client(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int my_pid = MSG_process_get_PID(MSG_process_self());
   // use my pid as name of mailbox to contact me
index 4527b0e..57c72f0 100644 (file)
@@ -17,8 +17,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(electric_fence, "Example to check the soundness of DPOR");
 
-
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -35,6 +34,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task = MSG_task_create(argv[1], 0, 10000, NULL);
 
   MSG_task_send(task, "mymailbox");
index 3a88921..d5e1c23 100644 (file)
@@ -19,6 +19,7 @@ static void task_cleanup_handler(void* task)
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -85,6 +86,7 @@ static int master(int argc, char *argv[])
 
 static int worker(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   char mailbox[80];
 
   long id= xbt_str_parse_int(argv[1], "Invalid argument %s");
index 97b3676..8e4e386 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/msg.h"
 
 /* Main function of the process I want to start manually */
-static int process_function(int argc, char *argv[])
+static int process_function(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = MSG_task_create("task", 100, 0, NULL);
   MSG_task_execute (task);
index a7e2513..f4f7421 100644 (file)
@@ -7,6 +7,7 @@
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   long workers_count = xbt_str_parse_int(argv[4], "Invalid amount of workers: %s");
 
@@ -36,7 +37,7 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int worker(int argc, char *argv[])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
 
index 2f01fa0..ae8a333 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   const char *hostname = MSG_host_get_name(MSG_host_self());
 
index 08dc58b..3c90c28 100644 (file)
@@ -13,7 +13,7 @@ static void create_and_execute_task (void)
   MSG_task_destroy (task);
 }
 
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   //set initial values for the link user variables this example only shows for links identified by "6" and "3" in the
   //platform file
index af7a222..906fd19 100644 (file)
@@ -9,6 +9,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_trace_masterworker, "Messages specific for this
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -40,7 +41,7 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int worker(int argc, char *argv[])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
 
index 2a7b21b..065ba52 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/msg.h"
 
 /* The guy we will move from host to host. It move alone and then is moved by policeman back  */
-static int emigrant(int argc, char *argv[])
+static int emigrant(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
   char *destination = NULL;
@@ -27,7 +27,7 @@ static int emigrant(int argc, char *argv[])
   return 0;
 }
 
-static int policeman(int argc, char *argv[])
+static int policeman(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   // I am the master of emigrant process,
   // I tell it where it must emigrate to.
index 6e4c729..b3722e0 100644 (file)
@@ -13,7 +13,7 @@ static void create_and_execute_task (void)
   MSG_task_destroy (task);
 }
 
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   //Set initial values for the link user variables
   //This example uses source and destination where source and destination are the name of hosts inthe platform file.
index 1fe801a..5fe9cc1 100644 (file)
@@ -12,6 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -86,6 +87,7 @@ static int alltoall_mpi(int argc, char *argv[])
 
 static int slave(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
   int id = -1;
index e38b70a..48d21ac 100644 (file)
@@ -149,7 +149,8 @@ void test_deref(simgrid::dwarf::ExpressionContext const& state) {
   }
 }
 
-int main(int argc, char** argv) {
+int main()
+{
   process = new simgrid::mc::RemoteClient(getpid(), -1);
   process->init();
 
index 2c4ce3f..ca13fd7 100644 (file)
@@ -30,7 +30,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 static xbt_mutex_t mutex = NULL;
 #endif
 
-static int receiver(int argc, char *argv[])
+static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
 
@@ -47,6 +47,7 @@ static int receiver(int argc, char *argv[])
 
 static int sender(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   char* message_name = argv[1];
 #ifndef DISABLE_THE_MUTEX
   xbt_mutex_acquire(mutex);
index 9de062f..825392d 100644 (file)
@@ -11,7 +11,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(random_bug, "Application");
 
 /** An (fake) application with a bug occuring for some random values */
-static int app(int argc, char *argv[])
+static int app(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int x = MC_random(0, 5);
   int y = MC_random(0, 5);
index 3c585b2..dc780b9 100644 (file)
@@ -10,7 +10,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_app_token_ring, "Messages specific for this msg example");
 
 /* Main function of all processes used in this example */
-static int relay_runner(int argc, char* argv[])
+static int relay_runner(int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   xbt_assert(argc == 0, "The relay_runner function does not accept any parameter from the XML deployment file");
   int rank = xbt_str_parse_int(MSG_process_get_name(MSG_process_self()),
index 3a4f493..b364e4f 100644 (file)
@@ -15,6 +15,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static int worker_main(int argc, char* argv[])
 {
+  xbt_assert(argc == 4);
   double computation_amount = xbt_str_parse_double(argv[1], "Invalid computation amount: %s");
   int use_bound             = xbt_str_parse_int(argv[2], "Second parameter (use_bound) should be 0 or 1 but is: %s");
   double bound              = xbt_str_parse_double(argv[3], "Invalid bound: %s");
@@ -51,7 +52,7 @@ static void launch_worker(msg_host_t host, const char* pr_name, double computati
   MSG_process_create_with_arguments(pr_name, worker_main, NULL, host, 4, argv);
 }
 
-static int worker_busy_loop_main(int argc, char* argv[])
+static int worker_busy_loop_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t* task = MSG_process_get_data(MSG_process_self());
   MSG_task_execute(*task);
@@ -189,7 +190,7 @@ static void test_two_tasks(msg_host_t hostA, msg_host_t hostB)
   MSG_process_sleep(1000);
 }
 
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Fafard");
index dc9f1f2..d3603d7 100644 (file)
@@ -50,7 +50,7 @@ static void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm)
   MSG_process_create_with_arguments(pr_name, migration_worker_main, NULL, host, 3, argv);
 }
 
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Tremblay");
index 186ffa4..0985122 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int computation_fun(int argc, char* argv[])
+static int computation_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   const char* pr_name   = MSG_process_get_name(MSG_process_self());
   const char* host_name = MSG_host_get_name(MSG_host_self());
@@ -106,7 +106,7 @@ static void launch_communication_worker(msg_host_t tx_host, msg_host_t rx_host)
   xbt_free(mbox);
 }
 
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Tremblay");
index 82d9f95..aca6082 100644 (file)
@@ -9,7 +9,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int dvfs(int argc, char* argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t host = MSG_host_by_name("MyHost1");
 
index 2ffc29a..e0afcf4 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
 
-static int dvfs(int argc, char* argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   double workload = 100E6;
   msg_host_t host = MSG_host_self();
index 821d5d8..eb97efd 100644 (file)
@@ -8,7 +8,7 @@
 #include <float.h>
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example");
 
-static int sender_fun(int argc, char *argv[])
+static int sender_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Sending");
   MSG_task_send(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_get_name(MSG_host_self()));
@@ -17,7 +17,7 @@ static int sender_fun(int argc, char *argv[])
   return 0;
 }
 
-static int receiver_fun(int argc, char *argv[])
+static int receiver_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Receiving");
   msg_task_t task = NULL;
index db526a4..9b1152b 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
@@ -38,7 +38,7 @@ static int slave(int argc, char *argv[])
   return 0;
 }
 
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   double task_comp_size = 5E7;
   double task_comm_size = 1E6;
index 3c7b6d8..5c4f339 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static const char* mailbox = "comm";
 
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t jupiter = MSG_host_by_name("Jupiter");
 
@@ -35,7 +35,7 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Slave receiving");
   msg_task_t task = NULL;
index fd77c08..5910d5b 100644 (file)
@@ -10,7 +10,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(io_file, "Messages specific for this io example");
 
-static int host(int argc, char* argv[])
+static int host(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_file_t file = NULL;
   sg_size_t read;
index 9d8f417..0e727f1 100644 (file)
@@ -9,7 +9,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int execute_load_test(int argc, char* argv[])
+static int execute_load_test(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t host = MSG_host_by_name("MyHost1");
 
index 4bbc66e..d6560d5 100644 (file)
@@ -8,7 +8,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_daemon, "Messages specific for this msg example");
 
 /* The worker process, working for a while before leaving */
-static int worker_process(int argc, char* argv[])
+static int worker_process(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Let's do some work (for 10 sec on Boivin).");
   msg_task_t task = MSG_task_create("easy work", 980.95e6, 0, NULL);
@@ -20,7 +20,7 @@ static int worker_process(int argc, char* argv[])
 }
 
 /* The daemon, displaying a message every 3 seconds until all other processes stop */
-static int daemon_process(int argc, char* argv[])
+static int daemon_process(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   MSG_process_daemonize(MSG_process_self());
 
index 771bb6e..9e7a4ad 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int slave(int argc, char* argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Slave started");
   MSG_process_sleep(3);
@@ -16,7 +16,7 @@ static int slave(int argc, char* argv[])
   return 0;
 }
 
-static int master(int argc, char* argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_process_t process;
 
index 602e1af..afa3c7f 100644 (file)
@@ -19,6 +19,7 @@ static int my_onexit(XBT_ATTRIB_UNUSED int ignored1, XBT_ATTRIB_UNUSED void* ign
 /* Just sleep until termination */
 static int sleeper(int argc, char* argv[])
 {
+  xbt_assert(argc == 2);
   XBT_INFO("Hello! I go to sleep.");
   MSG_process_on_exit(my_onexit, NULL);
 
index a53583f..66322d2 100644 (file)
@@ -11,7 +11,7 @@ msg_bar_t barrier;
 static msg_process_t controlled_process = NULL;
 
 /* The Emigrant process will be moved from host to host. */
-static int emigrant(int argc, char* argv[])
+static int emigrant(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("I'll look for a new job on another machine ('Boivin') where the grass is greener.");
   MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin")); /* - First, move to another host by myself */
@@ -35,7 +35,7 @@ static int emigrant(int argc, char* argv[])
 }
 
 /* The policeman check for emigrants and move them back to 'Jacquelin' */
-static int policeman(int argc, char* argv[])
+static int policeman(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Wait at the checkpoint."); /* - block on the mutex+condition */
   MSG_barrier_wait(barrier);
index 19c020f..f28573d 100644 (file)
@@ -9,7 +9,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_suspend, "Messages specific for this msg example");
 
 /* The Lazy guy only wants to sleep, but can be awaken by the dream_master process. */
-static int lazy_guy(int argc, char* argv[])
+static int lazy_guy(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Nobody's watching me ? Let's go to sleep.");
   MSG_process_suspend(MSG_process_self()); /* - Start by suspending itself */
@@ -33,7 +33,7 @@ static int lazy_guy(int argc, char* argv[])
 }
 
 /* The Dream master: */
-static int dream_master(int argc, char* argv[])
+static int dream_master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
   msg_process_t lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
index fcecaa2..bc52e13 100644 (file)
@@ -8,6 +8,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static int test(int argc, char* argv[])
 {
+  xbt_assert(argc == 3);
   double computation_amount = xbt_str_parse_double(argv[1], "Invalid argument: %s");
   double priority           = xbt_str_parse_double(argv[2], "Invalid argument: %s");
 
index e34396b..653845b 100644 (file)
@@ -9,7 +9,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int tester(int argc, char* argv[])
+static int tester(int, char**)
 {
   msg_task_t task = MSG_task_create("name", 0, 10, NULL);
   msg_comm_t comm = MSG_task_isend(task, "mailbox");