Re: [PATCH 01/16] selftests/mm: remove argc and argv unused parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu,  9 Jan 2025 22:38:27 +0500
Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> wrote:

> Remove the following warnings by removing unused argc and argv
> parameters:
> In function ‘main’:
>   warning: unused parameter ‘argc’ [-Wunused-parameter]
>     158 | int main(int argc, char *argv[])
>         |          ~~~~^~~~
>   warning: unused parameter ‘argv’ [-Wunused-parameter]
>     158 | int main(int argc, char *argv[])
...
> diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c
> index 2c3a0eb6b22d3..8d23b698ce9db 100644
> --- a/tools/testing/selftests/mm/compaction_test.c
> +++ b/tools/testing/selftests/mm/compaction_test.c
> @@ -194,7 +194,7 @@ int set_zero_hugepages(unsigned long *initial_nr_hugepages)
>  	return ret;
>  }
>  
> -int main(int argc, char **argv)
> +int main(void)

Doesn't that generate a different warning because main() is a special function
and gcc knows the arguments it should have.

Just disable -Wunused-parameter - there are far too many places where it produces
unwanted warnings.

	David





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux