Bug 1613 - Can't build ns-3-dev with g++ 4.7.2 (error in fd-net-device/helper/tap-creator.cc)
Can't build ns-3-dev with g++ 4.7.2 (error in fd-net-device/helper/tap-creato...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: emulation
ns-3-dev
All All
: P2 major
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-28 12:13 UTC by Lalith Suresh
Modified: 2013-03-30 17:45 UTC (History)
1 user (show)

See Also:


Attachments
Fix (724 bytes, application/octet-stream)
2013-03-28 12:13 UTC, Lalith Suresh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lalith Suresh 2013-03-28 12:13:07 UTC
Created attachment 1547 [details]
Fix

(I can't find a 'fd-net-device' component in bugzilla, so I'll add it under emulation for now.)

Here's what I get when I try to build ns-3-dev.


$: uname -a
Linux irule 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 i686 i686 i686 GNU/Linux

$: g++ --version
g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$: hg tip
changeset:   9272:32d40ab86df5
tag:         tip
user:        Vedran Miletić <rivanvx@gmail.com>
date:        Thu Mar 28 10:31:56 2013 +0100
summary:     Fix INCLUDE_GUARD in create-module.py

$: ./waf configure --disable-python --enable-examples --enable-modules=applications
$: ./waf build

...
[945/953] cxx: src/fd-net-device/helper/creator-utils.cc -> build/src/fd-net-device/helper/creator-utils.cc.4.o
../src/fd-net-device/helper/tap-creator.cc: In function ‘int main(int, char**)’:
../src/fd-net-device/helper/tap-creator.cc:299:16: error: converting to non-pointer type ‘int’ from NULL [-Werror=conversion-null]
../src/fd-net-device/helper/tap-creator.cc:360:7: error: NULL used in arithmetic [-Werror=pointer-arith]
cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/lalith/programming/click-merge/final/fd-net-device-test/build'
Build failed
 -> task in 'tap-creator' failed (exit status 1): 
	{task 156864620: cxx tap-creator.cc -> tap-creator.cc.4.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_TAP_CREATOR=1', '-DHAVE_PACKET_H=1', '-DHAVE_RAW_SOCKET_CREATOR=1', '-DHAVE_IF_TUN_H=1', '../src/fd-net-device/helper/tap-creator.cc', '-c', '-o', 'src/fd-net-device/helper/tap-creator.cc.4.o']
...


Patch attached.
Comment 1 alina 2013-03-29 11:24:37 UTC
(In reply to comment #0)
> Created attachment 1547 [details]
> Fix
> 
> (I can't find a 'fd-net-device' component in bugzilla, so I'll add it under
> emulation for now.)
> 
> Here's what I get when I try to build ns-3-dev.
> 
> 
> $: uname -a
> Linux irule 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 i686
> i686 i686 GNU/Linux
> 
> $: g++ --version
> g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
> Copyright (C) 2012 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $: hg tip
> changeset:   9272:32d40ab86df5
> tag:         tip
> user:        Vedran Miletić <rivanvx@gmail.com>
> date:        Thu Mar 28 10:31:56 2013 +0100
> summary:     Fix INCLUDE_GUARD in create-module.py
> 
> $: ./waf configure --disable-python --enable-examples
> --enable-modules=applications
> $: ./waf build
> 
> ...
> [945/953] cxx: src/fd-net-device/helper/creator-utils.cc ->
> build/src/fd-net-device/helper/creator-utils.cc.4.o
> ../src/fd-net-device/helper/tap-creator.cc: In function ‘int main(int,
> char**)’:
> ../src/fd-net-device/helper/tap-creator.cc:299:16: error: converting to
> non-pointer type ‘int’ from NULL [-Werror=conversion-null]
> ../src/fd-net-device/helper/tap-creator.cc:360:7: error: NULL used in
> arithmetic [-Werror=pointer-arith]
> cc1plus: all warnings being treated as errors
> Waf: Leaving directory
> `/home/lalith/programming/click-merge/final/fd-net-device-test/build'
> Build failed
>  -> task in 'tap-creator' failed (exit status 1): 
>     {task 156864620: cxx tap-creator.cc -> tap-creator.cc.4.o}
> ['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror',
> '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing',
> '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1',
> '-DHAVE_IF_NETS_H=1', '-DHAVE_TAP_CREATOR=1', '-DHAVE_PACKET_H=1',
> '-DHAVE_RAW_SOCKET_CREATOR=1', '-DHAVE_IF_TUN_H=1',
> '../src/fd-net-device/helper/tap-creator.cc', '-c', '-o',
> 'src/fd-net-device/helper/tap-creator.cc.4.o']
> ...
> 
> 
> Patch attached.

Thank you for the patch. 
I have added the fix in changeset 98c7f435b0a3.

Could you please try compiling again and confirm whether it now works?
Comment 2 Tommaso Pecorella 2013-03-30 17:44:06 UTC
Works in MacOSX (the build, don't have time to check the fd-net-device right now)
Comment 3 Lalith Suresh 2013-03-30 17:45:18 UTC
I reviewed this last night. It works fine for me, so I'll close this bug until someone else reports some issue.