Skip to content
  • Rolf Eike Beer's avatar
    SystemInformation: fix truncation warnings · 87abd647
    Rolf Eike Beer authored
    .../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
    87abd647