[SLOF] [PATCH] dhcp: fix warning messages when calling strtoip()
Nikunj A Dadhania
nikunj at linux.vnet.ibm.com
Wed Feb 10 15:59:00 AEDT 2016
Alexey Kardashevskiy <aik at ozlabs.ru> writes:
> On 02/09/2016 05:05 PM, Nikunj A Dadhania wrote:
>> With the removal of dupicate strtoip in patch "dhcp: Remove duplicated
>> strtoip()" (commit 896e31da2cc260bf5311a89b63683def20329c5b), we get
>> following warnings messages:
>>
>> dhcp.c: In function ‘dhcpv4’:
>> dhcp.c:215:16: warning: pointer targets in passing argument 1 of ‘strtoip’ differ in signedness [-Wpointer-sign]
>> if (!strtoip(dhcp_tftp_name, (uint8_t *)&dhcp_tftp_ip)) {
>> ^
>> In file included from dhcp.c:51:0:
>> ../netapps/args.h:20:5: note: expected ‘const char *’ but argument is of type ‘int8_t * {aka signed char *}’
>> int strtoip(const char *, char[4]);
>> ^
>> dhcp.c:215:32: warning: pointer targets in passing argument 2 of ‘strtoip’ differ in signedness [-Wpointer-sign]
>> if (!strtoip(dhcp_tftp_name, (uint8_t *)&dhcp_tftp_ip)) {
>> ^
>> In file included from dhcp.c:51:0:
>> ../netapps/args.h:20:5: note: expected ‘char *’ but argument is of type ‘uint8_t * {aka unsigned char *}’
>> int strtoip(const char *, char[4]);
>> ^
>
> How did you run make? These did not produce any warning with gcc 5.1.1
> (fedora23) and 5.2.1 (compiled from sources):
$ make clean && CROSS=powerpc64-linux-gnu- make qemu
$ powerpc64-linux-gnu-gcc --version
powerpc64-linux-gnu-gcc (GCC) 5.1.1 20150618 (Red Hat Cross 5.1.1-3)
$
>
> touch clients/net-snk/app/netlib/dhcp.c
> make qemu WARNFLAGS=-Wextra
Comes without -Wextra.
Regards
Nikunj
More information about the SLOF
mailing list