Bugzilla – Bug 1148
variable ‘curtok’ set but not used
Last modified: 2011-08-09 19:13:54 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
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
Created attachment 1116 [details] patch
Created attachment 1117 [details] overlapping patches, adding a new one here overlapping patches, adding a new one here
(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?
(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.