[LTP] [PATCH v2 2/2] syscalls/clock_adjtime: create clock_adjtime syscall tests

Enji Cooper yaneurabeya@gmail.com
Tue Feb 26 01:24:53 CET 2019



> On Feb 25, 2019, at 4:17 PM, Petr Vorel <pvorel@suse.cz> wrote:
> 
> Hi Rafael,
> 
>> diff --git a/testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c b/testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c
>> new file mode 100644
>> index 000000000..541d9437d
> ...
> 
>> +	SAFE_CLOCK_ADJTIME(CLOCK_REALTIME, &ttxc);
>> +	timex_show("SET", ttxc);
>> +
>> +	if (tc[i].ptr) {
>> +
>> +		/* adjtimex field being tested so we can verify later */
>> +
>> +		ptroff = (long) tc[i].ptr - (long) &ttxc;
>> +		ptr = (void *) &verify + ptroff;
>> +	}
>> +
>> +	TEST(sys_clock_adjtime(CLOCK_REALTIME, &verify));
>> +	timex_show("VERIFY", verify);
>> +
>> +	if (tc[i].ptr && *tc[i].ptr != *ptr) {
> Can you please fix this compiler error:
> clock_adjtime01.c: In function ‘verify_clock_adjtime’:
> clock_adjtime01.c:199:33: warning: ‘ptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>  if (tc[i].ptr && *tc[i].ptr != *ptr) {

Wow. That’s a really dumb, tautologically impossible compiler error :(…
-Enji


More information about the ltp mailing list