From: Arnaud Giersch Date: Mon, 3 Jun 2019 09:44:08 +0000 (+0200) Subject: Unused parameters argc/argv. X-Git-Tag: v3.22.4~24 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/60211815916d3fd883c13c8bee9cb6d3ce3d2974 Unused parameters argc/argv. --- diff --git a/examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c b/examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c index f9d1ed1eae..cb9bfb5bc6 100644 --- a/examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c +++ b/examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c @@ -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; diff --git a/examples/deprecated/msg/energy-vm/energy-vm.c b/examples/deprecated/msg/energy-vm/energy-vm.c index e4c8ce9be9..1f35d8bb6a 100644 --- a/examples/deprecated/msg/energy-vm/energy-vm.c +++ b/examples/deprecated/msg/energy-vm/energy-vm.c @@ -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"); diff --git a/examples/deprecated/msg/mc/bugged1.c b/examples/deprecated/msg/mc/bugged1.c index b4454feebf..0390959936 100644 --- a/examples/deprecated/msg/mc/bugged1.c +++ b/examples/deprecated/msg/mc/bugged1.c @@ -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"); diff --git a/examples/deprecated/msg/mc/bugged1_liveness.c b/examples/deprecated/msg/mc/bugged1_liveness.c index 95880ebc84..8fd8490502 100644 --- a/examples/deprecated/msg/mc/bugged1_liveness.c +++ b/examples/deprecated/msg/mc/bugged1_liveness.c @@ -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]); diff --git a/examples/deprecated/msg/mc/bugged2.c b/examples/deprecated/msg/mc/bugged2.c index c659568b79..aaf1dc1a58 100644 --- a/examples/deprecated/msg/mc/bugged2.c +++ b/examples/deprecated/msg/mc/bugged2.c @@ -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); diff --git a/examples/deprecated/msg/mc/bugged2_liveness.c b/examples/deprecated/msg/mc/bugged2_liveness.c index 19c5740571..2b68854dfa 100644 --- a/examples/deprecated/msg/mc/bugged2_liveness.c +++ b/examples/deprecated/msg/mc/bugged2_liveness.c @@ -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]); diff --git a/examples/deprecated/msg/mc/bugged3.c b/examples/deprecated/msg/mc/bugged3.c index 3546021248..c2237041fe 100644 --- a/examples/deprecated/msg/mc/bugged3.c +++ b/examples/deprecated/msg/mc/bugged3.c @@ -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]); diff --git a/examples/deprecated/msg/mc/centralized_mutex.c b/examples/deprecated/msg/mc/centralized_mutex.c index 771cd468f8..bf21be136f 100644 --- a/examples/deprecated/msg/mc/centralized_mutex.c +++ b/examples/deprecated/msg/mc/centralized_mutex.c @@ -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 diff --git a/examples/deprecated/msg/mc/electric_fence.c b/examples/deprecated/msg/mc/electric_fence.c index 4527b0e57c..57c72f02b2 100644 --- a/examples/deprecated/msg/mc/electric_fence.c +++ b/examples/deprecated/msg/mc/electric_fence.c @@ -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"); diff --git a/examples/deprecated/msg/platform-failures/platform-failures.c b/examples/deprecated/msg/platform-failures/platform-failures.c index 3a88921320..d5e1c23834 100644 --- a/examples/deprecated/msg/platform-failures/platform-failures.c +++ b/examples/deprecated/msg/platform-failures/platform-failures.c @@ -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"); diff --git a/examples/deprecated/msg/process-create/process-create.c b/examples/deprecated/msg/process-create/process-create.c index 97b367644f..8e4e386731 100644 --- a/examples/deprecated/msg/process-create/process-create.c +++ b/examples/deprecated/msg/process-create/process-create.c @@ -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); diff --git a/examples/deprecated/msg/trace-categories/trace-categories.c b/examples/deprecated/msg/trace-categories/trace-categories.c index a7e251337d..f4f74215cc 100644 --- a/examples/deprecated/msg/trace-categories/trace-categories.c +++ b/examples/deprecated/msg/trace-categories/trace-categories.c @@ -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; diff --git a/examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c b/examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c index 2f01fa0f0e..ae8a333aac 100644 --- a/examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c +++ b/examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c @@ -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()); diff --git a/examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c b/examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c index 08dc58bb84..3c90c28676 100644 --- a/examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c +++ b/examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c @@ -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 diff --git a/examples/deprecated/msg/trace-masterworker/trace-masterworker.c b/examples/deprecated/msg/trace-masterworker/trace-masterworker.c index af7a2223a6..906fd19843 100644 --- a/examples/deprecated/msg/trace-masterworker/trace-masterworker.c +++ b/examples/deprecated/msg/trace-masterworker/trace-masterworker.c @@ -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; diff --git a/examples/deprecated/msg/trace-process-migration/trace-process-migration.c b/examples/deprecated/msg/trace-process-migration/trace-process-migration.c index 2a7b21b639..065ba528ea 100644 --- a/examples/deprecated/msg/trace-process-migration/trace-process-migration.c +++ b/examples/deprecated/msg/trace-process-migration/trace-process-migration.c @@ -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. diff --git a/examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c b/examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c index 6e4c7292a6..b3722e0df3 100644 --- a/examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c +++ b/examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c @@ -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. diff --git a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c index 1fe801ae11..5fe9cc1792 100644 --- a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c +++ b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c @@ -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; diff --git a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp index e38b70ad0c..48d21acf2c 100644 --- a/teshsuite/mc/dwarf-expression/dwarf-expression.cpp +++ b/teshsuite/mc/dwarf-expression/dwarf-expression.cpp @@ -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(); diff --git a/teshsuite/mc/mutex-handling/mutex-handling.c b/teshsuite/mc/mutex-handling/mutex-handling.c index 2c4ce3f6e8..ca13fd7995 100644 --- a/teshsuite/mc/mutex-handling/mutex-handling.c +++ b/teshsuite/mc/mutex-handling/mutex-handling.c @@ -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); diff --git a/teshsuite/mc/random-bug/random-bug.c b/teshsuite/mc/random-bug/random-bug.c index 9de062f9f7..825392df36 100644 --- a/teshsuite/mc/random-bug/random-bug.c +++ b/teshsuite/mc/random-bug/random-bug.c @@ -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); diff --git a/teshsuite/msg/app-token-ring/app-token-ring.c b/teshsuite/msg/app-token-ring/app-token-ring.c index 3c585b2688..dc780b937a 100644 --- a/teshsuite/msg/app-token-ring/app-token-ring.c +++ b/teshsuite/msg/app-token-ring/app-token-ring.c @@ -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()), diff --git a/teshsuite/msg/cloud-capping/cloud-capping.c b/teshsuite/msg/cloud-capping/cloud-capping.c index 3a4f4932b2..b364e4f4c0 100644 --- a/teshsuite/msg/cloud-capping/cloud-capping.c +++ b/teshsuite/msg/cloud-capping/cloud-capping.c @@ -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"); diff --git a/teshsuite/msg/cloud-migration/cloud-migration.c b/teshsuite/msg/cloud-migration/cloud-migration.c index dc9f1f2ea2..d3603d7908 100644 --- a/teshsuite/msg/cloud-migration/cloud-migration.c +++ b/teshsuite/msg/cloud-migration/cloud-migration.c @@ -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"); diff --git a/teshsuite/msg/cloud-simple/cloud-simple.c b/teshsuite/msg/cloud-simple/cloud-simple.c index 186ffa4ce7..0985122e8b 100644 --- a/teshsuite/msg/cloud-simple/cloud-simple.c +++ b/teshsuite/msg/cloud-simple/cloud-simple.c @@ -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"); diff --git a/teshsuite/msg/energy-consumption/energy-consumption.c b/teshsuite/msg/energy-consumption/energy-consumption.c index 82d9f95008..aca6082cca 100644 --- a/teshsuite/msg/energy-consumption/energy-consumption.c +++ b/teshsuite/msg/energy-consumption/energy-consumption.c @@ -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"); diff --git a/teshsuite/msg/energy-pstate/energy-pstate.c b/teshsuite/msg/energy-pstate/energy-pstate.c index 2ffc29a2cc..e0afcf4dd9 100644 --- a/teshsuite/msg/energy-pstate/energy-pstate.c +++ b/teshsuite/msg/energy-pstate/energy-pstate.c @@ -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(); diff --git a/teshsuite/msg/get_sender/get_sender.c b/teshsuite/msg/get_sender/get_sender.c index 821d5d8504..eb97efdca2 100644 --- a/teshsuite/msg/get_sender/get_sender.c +++ b/teshsuite/msg/get_sender/get_sender.c @@ -8,7 +8,7 @@ #include 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; diff --git a/teshsuite/msg/host_on_off/host_on_off.c b/teshsuite/msg/host_on_off/host_on_off.c index db526a4302..9b1152b7b6 100644 --- a/teshsuite/msg/host_on_off/host_on_off.c +++ b/teshsuite/msg/host_on_off/host_on_off.c @@ -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; diff --git a/teshsuite/msg/host_on_off_recv/host_on_off_recv.c b/teshsuite/msg/host_on_off_recv/host_on_off_recv.c index 3c7b6d84ec..5c4f339a3a 100644 --- a/teshsuite/msg/host_on_off_recv/host_on_off_recv.c +++ b/teshsuite/msg/host_on_off_recv/host_on_off_recv.c @@ -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; diff --git a/teshsuite/msg/io-file/io-file.c b/teshsuite/msg/io-file/io-file.c index fd77c08608..5910d5b83b 100644 --- a/teshsuite/msg/io-file/io-file.c +++ b/teshsuite/msg/io-file/io-file.c @@ -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; diff --git a/teshsuite/msg/plugin-hostload/plugin-hostload.c b/teshsuite/msg/plugin-hostload/plugin-hostload.c index 9d8f417f02..0e727f188d 100644 --- a/teshsuite/msg/plugin-hostload/plugin-hostload.c +++ b/teshsuite/msg/plugin-hostload/plugin-hostload.c @@ -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"); diff --git a/teshsuite/msg/process-daemon/process-daemon.c b/teshsuite/msg/process-daemon/process-daemon.c index 4bbc66eb98..d6560d514e 100644 --- a/teshsuite/msg/process-daemon/process-daemon.c +++ b/teshsuite/msg/process-daemon/process-daemon.c @@ -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()); diff --git a/teshsuite/msg/process-join/process-join.c b/teshsuite/msg/process-join/process-join.c index 771bb6e788..9e7a4adbee 100644 --- a/teshsuite/msg/process-join/process-join.c +++ b/teshsuite/msg/process-join/process-join.c @@ -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; diff --git a/teshsuite/msg/process-lifetime/process-lifetime.c b/teshsuite/msg/process-lifetime/process-lifetime.c index 602e1af7f2..afa3c7fb98 100644 --- a/teshsuite/msg/process-lifetime/process-lifetime.c +++ b/teshsuite/msg/process-lifetime/process-lifetime.c @@ -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); diff --git a/teshsuite/msg/process-migration/process-migration.c b/teshsuite/msg/process-migration/process-migration.c index a53583ff06..66322d217b 100644 --- a/teshsuite/msg/process-migration/process-migration.c +++ b/teshsuite/msg/process-migration/process-migration.c @@ -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); diff --git a/teshsuite/msg/process-suspend/process-suspend.c b/teshsuite/msg/process-suspend/process-suspend.c index 19c020fa20..f28573d2de 100644 --- a/teshsuite/msg/process-suspend/process-suspend.c +++ b/teshsuite/msg/process-suspend/process-suspend.c @@ -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()); diff --git a/teshsuite/msg/task-priority/task-priority.c b/teshsuite/msg/task-priority/task-priority.c index fcecaa228b..bc52e131ff 100644 --- a/teshsuite/msg/task-priority/task-priority.c +++ b/teshsuite/msg/task-priority/task-priority.c @@ -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"); diff --git a/teshsuite/msg/task_listen_from/task_listen_from.cpp b/teshsuite/msg/task_listen_from/task_listen_from.cpp index e34396bc0a..653845bc98 100644 --- a/teshsuite/msg/task_listen_from/task_listen_from.cpp +++ b/teshsuite/msg/task_listen_from/task_listen_from.cpp @@ -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");