lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1175024c-6ef7-4557-95ca-180dd0a3dd5b@collabora.com>
Date: Sat, 1 Feb 2025 12:32:20 +0500
From: Muhammad Usama Anjum <Usama.Anjum@...labora.com>
To: David Laight <david.laight.linux@...il.com>
Cc: Usama.Anjum@...labora.com, Kees Cook <kees@...nel.org>,
 Andy Lutomirski <luto@...capital.net>, Will Drewry <wad@...omium.org>,
 Shuah Khan <shuah@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
 Jérôme Glisse <jglisse@...hat.com>,
 linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org, kernel@...labora.com
Subject: Re: [PATCH 01/16] selftests/mm: remove argc and argv unused
 parameters

On 1/11/25 12:00 AM, David Laight wrote:
> On Thu,  9 Jan 2025 22:38:27 +0500
> Muhammad Usama Anjum <usama.anjum@...labora.com> 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.
No, we still get unused argument warning. 

> 
> Just disable -Wunused-parameter - there are far too many places where it produces
> unwanted warnings.
The purpose is to run static analyzer and find obvious errors to enhance quality of
the code which is only possible if we start using these compiler flags. This is just
my thinking.

Feel free to share your thoughts?

-- 
BR,
Muhammad Usama Anjum

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ