Bug 1119 - ns2-mobility-helper.cc:402: error: ignoring return value
This commit is contained in:
@@ -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 ();
|
||||
}
|
||||
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user