Skip to content
Snippets Groups Projects
Commit 87abd647 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

SystemInformation: fix truncation warnings

.../kwsys/SystemInformation.cxx: In member function ‘int cmsys::SystemInformationImplementation::GetFullyQualifiedDomainName(std::string&)’:
.../kwsys/SystemInformation.cxx:1475:31: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion]
         = (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6));
                               ^
.../kwsys/SystemInformation.cxx:1475:58: warning: conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Wconversion]
         = (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6));

POSIX says the type of the second argument to getnameinfo() should be
socklen_t so use that as the variable type here. Chances are high that this
has the same size as size_t so the warning would go away.

Change-Id: Ie2816b401a8fe7d615fa17a58b611e2cad14e4ea
parent f4928d44
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment