[SLOF] [PATCH v2] dhcp: fix warning messages when calling strtoip()
Thomas Huth
thuth at redhat.com
Wed Feb 10 19:38:27 AEDT 2016
On 10.02.2016 09:30, 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]);
> ^
>
> There were unnecessary typecasts which could be removed by declaring
> dhcp_tftp_name and dhcp_filename. Along with this, change the dns_get_ip
> signature as well to reduce typecast.
>
> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
> ---
> clients/net-snk/app/netapps/netboot.c | 2 +-
> clients/net-snk/app/netlib/dhcp.c | 16 ++++++++--------
> clients/net-snk/app/netlib/dns.c | 4 ++--
> clients/net-snk/app/netlib/dns.h | 2 +-
> 4 files changed, 12 insertions(+), 12 deletions(-)
Reviewed-by: Thomas Huth <thuth at redhat.com>
More information about the SLOF
mailing list