[Bro] Bro install problems on linux

Martin Casado casado at cs.stanford.edu
Fri Aug 26 10:01:40 PDT 2005


>
>
>
>Here is some example output, it's like this for alot of files though.
>
>g++ -DHAVE_CONFIG_H -I. -I. -I..  -I. -I../src -I. -I.. -Ilibedit 
>-I../linux-include -I../aux/libpcap-0.7.2 -O -g   -g -c -o main.o
>`test -f main.cc || echo './'`main.cc
>In file included from DNS_Mgr.h:28,
>                 from main.cc:42:
>EventHandler.h: In member function `void
>EventHandler::SourceIDList::insert(SourceID)':
>EventHandler.h:53: warning: cast to pointer from integer of different size
>EventHandler.h: In member function `void
>EventHandler::SourceIDList::sortedinsert(SourceID, int (*)(const
>void*, const void*))':
>EventHandler.h:53: warning: cast to pointer from integer of different size
>EventHandler.h: In member function `void
>EventHandler::SourceIDList::append(SourceID)':
>EventHandler.h:53: warning: cast to pointer from integer of different size
>EventHandler.h: In member function `SourceID
>
>  
>

 Unless I'm missing something, this does look broken.  Here are the 
snippets from the post-processed translation unit
of EventHandler.h:

 typedef void* ent;
 typedef uint32 SourceID;
 struct SourceIDList : BaseList { void insert(SourceID a) { 
BaseList::insert(ent(a)); }

 Needless to say, on a 64 bit architecture casting a 32bit into to a 
64bit value is a mistake.

 I'm assuming this code was written before templates became practical in a
performance sensitive environment.  Perhaps its time for an upgrade?

 .m



More information about the Bro mailing list