Bugzilla – Bug 488
[ns-3-tap] tap-bridge.cc fails to compile in optimized mode
Last modified: 2009-02-05 14:44:54 UTC
When configured with -d optimized, compiling src/devices/tap-bridge/tap-bridge.cc fails due to a warning about "ignored return value of write". (In "optimized" mode, warnings are treated as errors) The attached patch trivially fixed the issue.
Created attachment 371 [details] The patch
What compiler/os are you using?
This happens with both g++ (Ubuntu 4.3.2-1ubuntu12) 4.3.2 and g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3) It seems that some compilers do not emit the "unused return value" warning. As an alternative to my patch, I would suggest to add a "-Dwarn_unused_result= " string to the g++ command line to suppress the warning.
I committed a change to assign the return code to a variable with __attribute __ ((unused)). Please pull from craigdo/ns-3-tap and see if this works for you as I cannot yet manage to run this code through the nightly build mechanism.
Ok, now it works with: g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)