[LTP] [PATCH] syscalls/fcntl: add new test for open file description locks

Alexey Kodanev alexey.kodanev@oracle.com
Thu Apr 7 12:43:21 CEST 2016


Hi,
On 04/07/2016 11:26 AM, Cyril Hrubis wrote:
> Hi!
>>>> +		++res[(int)buf[0]];
>>>                            ^
>>> 			Do we really need to cast it to int here?
>>
>> Otherwise gcc would complain  "warning: array subscript has type ?char?"
> Hmm, perhaps the compiler tries to warn you that char may be signed or
> unsigned depending on a architecture and compiler implementation. Does
> the warning goes away if you declare the buf as a unsigned char?

Correct, it went away with unsigned char... more safe this way.

Thanks,
Alexey

>



More information about the ltp mailing list