Bug 1147 - variable ‘retOne’ set but not used, g++> 4.6.0
variable ‘retOne’ set but not used, g++> 4.6.0
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
All All
: P5 trivial
Assigned To: Mathieu Lacage
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-16 11:02 UTC by John Abraham
Modified: 2011-08-09 19:13 UTC (History)
1 user (show)

See Also:


Attachments
patch (850 bytes, patch)
2011-05-16 11:14 UTC, John Abraham
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Abraham 2011-05-16 11:02:39 UTC
Waf: Entering directory `/root/ns-3-test/ns-3-allinone/ns-3-dev/build'
[ 669/1561] cxx: src/core/examples/main-callback.cc -> build/debug/src/core/examples/main-callback_1.o
../src/core/examples/main-callback.cc: In function ‘int main(int, char**)’:                              
../src/core/examples/main-callback.cc:35:10: error: variable ‘retOne’ set but not used [-Werror=unused-but-set-variable]
../src/core/examples/main-callback.cc:47:7: error: variable ‘retTwo’ 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 main-callback.cc -> main-callback_1.o}                                                
[root@localhost ns-3-dev]# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.6.0/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.6.0 20110428 (Red Hat 4.6.0-6) (GCC)
Comment 1 John Abraham 2011-05-16 11:14:06 UTC
Created attachment 1114 [details]
patch

patch... As we want to retain retOne and retTwo for the purpose of illustrating how to capture a return value from a callback, to me just typecasting to (void) is good enough