Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nettop emerge fails: invalid lvalue in assignment
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
m27315
Apprentice
Apprentice


Joined: 10 Dec 2004
Posts: 253
Location: 2 workstations down

PostPosted: Thu Jun 08, 2006 3:43 am    Post subject: nettop emerge fails: invalid lvalue in assignment Reply with quote

I am trying to emerge nettop, but it gives me the following error... (Incidentally, I am using gcc 4.1)

Code:
>>> emerge (2 of 2) net-analyzer/nettop-0.2.3 to /
>>> md5 files   ;-) nettop-0.2.3.ebuild
>>> md5 files   ;-) files/nettop.c.patch
>>> md5 files   ;-) files/digest-nettop-0.2.3
>>> md5 src_uri ;-) nettop-0.2.3.tar.gz
>>> Unpacking source...
>>> Unpacking nettop-0.2.3.tar.gz to /var/tmp/portage/nettop-0.2.3/work
>>> Source unpacked.
 * Applying nettop.c.patch ...                                                                                                                                                                 [ ok ]
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -march=pentium2 -O2 -pipe  ) works... yes
checking whether the C compiler (gcc -march=pentium2 -O2 -pipe  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for pcap_lookupdev in -lpcap... yes
checking for pthread_exit in -lpthread... yes
checking for SLang_init_slang in -lslang... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for limits.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... yes
checking for netinet/in.h... yes
checking for netinet/in_system.h... no
checking return type of signal handlers... void
updating cache ./config.cache
creating ./config.status
creating Makefile
gcc  -I . -I   -march=pentium2 -O2 -pipe  -DVERSION=\"0.2.3\" -c nettop.c
nettop.c: In function 'main':
nettop.c:219: error: invalid lvalue in assignment
nettop.c:224: error: invalid lvalue in assignment
nettop.c:229: error: invalid lvalue in assignment
nettop.c:234: error: invalid lvalue in assignment
nettop.c:243: warning: incompatible implicit declaration of built-in function 'strlen'
nettop.c:246: warning: incompatible implicit declaration of built-in function 'strcpy'
nettop.c:254: warning: incompatible implicit declaration of built-in function 'strlen'
nettop.c:257: warning: incompatible implicit declaration of built-in function 'strcpy'
nettop.c: In function 'ts_run':
nettop.c:293: warning: incompatible implicit declaration of built-in function 'memcpy'
make: *** [nettop.o] Error 1

!!! ERROR: net-analyzer/nettop-0.2.3 failed.
!!! Function src_compile, Line 26, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.

emerge --info
Code:
Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.16-gentoo-r7 i686)
=================================================================
System uname: 2.6.16-gentoo-r7 i686 Pentium II (Deschutes)
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium2 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/X11/xkb /usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apache2 audiofile bash-completion berkdb bitmap-fonts bzip2 cli crypt dri eds emacs emboss esd expat fam fortran gd gif gmp gpm gstreamer imlib ipv6 isdnlog jpeg libg++ libwww mhash motif mp3 mpeg mysql ncurses nls nptl nptlonly ogg opengl pam pcre pdflib perl php png pppd python readline reflection sdl session slang snmp spell spl ssl svga tcltk tcpd tiff tokenizer truetype truetype-fonts type1-fonts udev unicode usb vhosts vorbis x86 xml xml2 xorg xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS, PORTDIR_OVERLAY

Any guesses? I am stumped!
Back to top
View user's profile Send private message
I.C.Wiener
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jul 2004
Posts: 115
Location: Furtwangen (Germany)

PostPosted: Sat Jun 17, 2006 3:40 pm    Post subject: Reply with quote

same error here, it won't compile with gcc4.1 (gcc 3.x works).

It's quite simple to get rid of those compile errors, here's what you need to change:

nettop.c
Code:


/* insert this line somwhere on top to get rid of warnings like "implicit declaration of strxxx" */
#include <string.h>

/* line 219: ether.count = ether.size = (int) ether.l = (int) ether.r = 0; */
   ether.count = ether.size = 0;
   ether.l = ether.r = 0;
...

/* line 224: ip.count = ip.size = (int) ip.l = (int) ip.r = 0; */
   ip.count = ip.size = 0;
   ip.l = ip.r = 0;
...

/* line 229: tcp.count = tcp.size = (int) tcp.l = (int) tcp.r = 0; */
   tcp.count = tcp.size = 0;
   tcp.l = tcp.r = 0;
...

/* line 234: udp.count = udp.size = (int) udp.l = (int) udp.r = 0; */
   udp.count = udp.size = 0;
   udp.l = udp.r = 0;



I mean it's kind of creative to cast 2 pointers to an interger and then assign them to an unsigned int and an unsigned long long :D But unfortunately gcc 4.1 doesn't like it.

So I got nettop compiled but valgrind complains about some invalid reads and I got a segmentation fault, so I think there is more to be fixed. Don't have time right now, but I'll have a closer look next week.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum