Bug 1661 - Variable ub1 defined but not used in ipv6-address.cc
Variable ub1 defined but not used in ipv6-address.cc
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: ipv6
ns-3-dev
All Linux
: P5 trivial
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-29 05:59 UTC by kronat
Modified: 2013-04-29 13:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kronat 2013-04-29 05:59:48 UTC
I got this error compiling with -Wall -Werror:

../src/network/utils/ipv6-address.cc: In function ‘uint32_t ns3::lookuphash(unsigned char*, uint32_t, uint32_t)’:
../src/network/utils/ipv6-address.cc:64:26: error: typedef ‘ub1’ locally defined but not used [-Werror=unused-local-typedefs]
   typedef unsigned  char ub1;   /* unsigned 1-byte quantities */
                          ^
cc1plus: all warnings being treated as errors
Waf: Leaving directory `/run/media/danimoth/e6fe8c8a-2084-4bf3-9d12-1750ff26b636/Work/ns-3-dev/build'
Build failed
 -> task in 'ns3-network' failed (exit status 1): 
        {task 21381520: cxx ipv6-address.cc -> ipv6-address.cc.1.o}
['/usr/bin/g++', '-Wall', '-Werror', '-fPIC', '-pthread', '-I.', '-I..', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '../src/network/utils/ipv6-address.cc', '-c', '-o', 'src/network/utils/ipv6-address.cc.1.o']
./waf -j8  346,70s user 21,06s system 722% cpu 50,889 total


My version of GCC is 4.8.0 20130411. A trivial patch is here:

diff -r 8e5c78e820f2 src/network/utils/ipv6-address.cc
--- a/src/network/utils/ipv6-address.cc Fri Apr 26 14:06:06 2013 -0700
+++ b/src/network/utils/ipv6-address.cc Mon Apr 29 11:58:57 2013 +0200
@@ -61,7 +61,6 @@
    })
 
   typedef uint32_t  ub4;   /* unsigned 4-byte quantities */
-  typedef unsigned  char ub1;   /* unsigned 1-byte quantities */
   uint32_t a = 0;
   uint32_t b = 0;
   uint32_t c = 0;

Thank you
Comment 1 kronat 2013-04-29 06:02:16 UTC
I forgot that I'm on the changeset 9725:8e5c78e820f2
Comment 2 Tommaso Pecorella 2013-04-29 06:11:38 UTC
+1

I'll patch as soon as I can.
Comment 3 kronat 2013-04-29 06:23:02 UTC
I'm evaluating to partecipate in GSoC (but I'm interested in a idea from another student..). Anyway, this could be okay for the patch requirement ?
Comment 4 Tommaso Pecorella 2013-04-29 13:53:57 UTC
Pushed in changeset 9730:caa72139e284