From b67badc5241c1e267fe67c94a5b4dc66f6fbc07b Mon Sep 17 00:00:00 2001 From: Mattias Axelsson Date: Thu, 13 Feb 2025 08:25:44 +0100 Subject: [PATCH] Declare main void when argc and argv are unused --- axoverlay/app/axoverlay.c | 9 +-------- axstorage/app/axstorage.c | 3 --- curl-openssl/app/curl_openssl.c | 1 - hello-world/app/hello_world.c | 9 +-------- .../consume-scene-metadata/app/consume_scene_metadata.c | 4 +--- reproducible-package/app/reproducible_package.c | 9 +-------- 6 files changed, 4 insertions(+), 31 deletions(-) diff --git a/axoverlay/app/axoverlay.c b/axoverlay/app/axoverlay.c index b230cf9b..5e38cf13 100644 --- a/axoverlay/app/axoverlay.c +++ b/axoverlay/app/axoverlay.c @@ -342,15 +342,8 @@ static gboolean signal_handler(gpointer loop) { * * This main function draws two plain boxes and one text, using the * API axoverlay. - * - * param argc Number of arguments. - * param argv Arguments vector. */ -int main(int argc, char** argv) { - /* Silence compiler warnings for unused parameters/arguments */ - (void)argc; - (void)argv; - +int main(void) { GMainLoop* loop = NULL; GError* error = NULL; GError* error_text = NULL; diff --git a/axstorage/app/axstorage.c b/axstorage/app/axstorage.c index 4248e516..3ed824af 100644 --- a/axstorage/app/axstorage.c +++ b/axstorage/app/axstorage.c @@ -368,9 +368,6 @@ static disk_item_t* new_disk_item_t(gchar* storage_id) { /** * @brief Main function * - * @param argc Number of arguments - * @param argv Arguments vector - * * @return Result */ gint main(void) { diff --git a/curl-openssl/app/curl_openssl.c b/curl-openssl/app/curl_openssl.c index 9987b19b..f25db173 100644 --- a/curl-openssl/app/curl_openssl.c +++ b/curl-openssl/app/curl_openssl.c @@ -226,5 +226,4 @@ int main(void) { } // Cleanup of curl global environment curl_global_cleanup(); - return 0; } diff --git a/hello-world/app/hello_world.c b/hello-world/app/hello_world.c index 45871082..13fe9fbe 100644 --- a/hello-world/app/hello_world.c +++ b/hello-world/app/hello_world.c @@ -29,15 +29,8 @@ * brief Main function. * * This main function writes "hello_world" to the syslog. - * - * param argc Number of arguments. - * param argv Arguments vector. */ -int main(int argc, char** argv) { - /* Silence compiler warnings for unused parameters/arguments */ - (void)argc; - (void)argv; - +int main(void) { /* Open the syslog to report messages for "hello_world" */ openlog("hello_world", LOG_PID | LOG_CONS, LOG_USER); diff --git a/message-broker/consume-scene-metadata/app/consume_scene_metadata.c b/message-broker/consume-scene-metadata/app/consume_scene_metadata.c index 00d888e6..69889e9a 100644 --- a/message-broker/consume-scene-metadata/app/consume_scene_metadata.c +++ b/message-broker/consume-scene-metadata/app/consume_scene_metadata.c @@ -80,9 +80,7 @@ static void sig_handler(int signum) { // Do nothing, just let pause in main return. } -int main(int argc, char** argv) { - (void)argc; - (void)argv; +int main(void) { syslog(LOG_INFO, "Subscriber started..."); // For com.axis.analytics_scene_description.v0.beta source corresponds to the diff --git a/reproducible-package/app/reproducible_package.c b/reproducible-package/app/reproducible_package.c index d1046344..016dda94 100644 --- a/reproducible-package/app/reproducible_package.c +++ b/reproducible-package/app/reproducible_package.c @@ -29,15 +29,8 @@ * brief Main function. * * This main function writes "Hello Reproducible World" to the syslog. - * - * param argc Number of arguments. - * param argv Arguments vector. */ -int main(int argc, char** argv) { - /* Silence compiler warnings for unused parameters/arguments */ - (void)argc; - (void)argv; - +int main(void) { /* Open the syslog to report messages for "reproducible_package" */ openlog("reproducible_package", LOG_PID | LOG_CONS, LOG_USER);