Bug 1119 - ns2-mobility-helper.cc:402: error: ignoring return value

This commit is contained in:
John Abraham
2011-05-18 16:23:38 -04:00
parent 1c345c4d76
commit 35677408e0
2 changed files with 6 additions and 2 deletions

View File

@@ -399,7 +399,9 @@ bool
IsNumber (const string& s)
{
char *endp;
(void) strtod (s.c_str (), &endp); // declared with warn_unused_result
double v = strtod (s.c_str (), &endp); // declared with warn_unused_result
//cast v to void, to suppress v set but not used compiler warning
(void) v;
return endp == s.c_str () + s.size ();
}

View File

@@ -208,7 +208,9 @@ RocketfuelTopologyReader::GenerateFromWeightsFile (int argc, char *argv[])
sname = argv[0];
tname = argv[1];
(void) strtod (argv[2], &endptr); // weight
double v = strtod (argv[2], &endptr); // weight
// cast v to void , to suppress 'v' set but not used compiler warning
(void) v;
if (*endptr != '\0')
{
NS_LOG_WARN ("invalid weight: " << argv[2]);