Bug 1148

Summary: variable ‘curtok’ set but not used
Product: ns-3 Reporter: John Abraham <john.abraham.in>
Component: networkAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: trivial CC: tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch
patch
overlapping patches, adding a new one here

Description John Abraham 2011-05-16 11:25:10 UTC
[ 708/1561] cxx: src/network/utils/ipv6-address.cc -> build/debug/src/network/utils/ipv6-address_1.o     
../src/network/utils/ipv6-address.cc: In function ‘bool ns3::AsciiToIpv6Host(const char*, uint8_t*)’:    
../src/network/utils/ipv6-address.cc:128:15: error: variable ‘curtok’ set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

Waf: Leaving directory `/root/ns-3-test/ns-3-allinone/ns-3-dev/build'
Build failed:  -> task failed (err #1): 
        {task: cxx ipv6-address.cc -> ipv6-address_1.o}          


---------------------
curtok was used previously in a block of code which is a TODO block now.

      /* TODO Handle IPv4 mapped address (2001::192.168.0.1) */
#if 0
      if (ch == '.' && ((tp + 4 /*NS_INADDRSZ*/) <= endp) &&
          inet_pton4(curtok, tp) > 0)
        {
          tp += 4 /*NS_INADDRSZ*/;
          seen_xdigits = 0;
          break; /* '\0' was seen by inet_pton4(). */
        }
#endif
Comment 1 John Abraham 2011-05-16 11:27:14 UTC
Created attachment 1115 [details]
patch

we could comment out curtOk, but since curtOk is part of a TODO block , for tracking purposes, we could put curtOk between #if 0 and #endif , until the TODO block is removed
Comment 2 John Abraham 2011-05-16 11:37:05 UTC
Created attachment 1116 [details]
patch
Comment 3 John Abraham 2011-05-16 11:40:26 UTC
Created attachment 1117 [details]
overlapping patches, adding a new one here

overlapping patches, adding a new one here
Comment 4 Tom Henderson 2011-05-16 11:48:05 UTC
(In reply to comment #3)
> Created attachment 1117 [details]
> overlapping patches, adding a new one here
> 
> overlapping patches, adding a new one here

why not just remove the unused variables?
Comment 5 John Abraham 2011-05-16 11:50:48 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Created attachment 1117 [details]
> > overlapping patches, adding a new one here
> > 
> > overlapping patches, adding a new one here
> 
> why not just remove the unused variables?

Well, since the TODO block still uses curtok, I thought we must leave curtok, as it is, so that when the TODO block is fixed we know where curtok was in the first place.