[Bro] Problems compiling with --enable-int64

Joel Ebrahimi joel.ebrahimi at gmail.com
Tue Apr 15 18:54:44 PDT 2008


When compiling with the --enable-int64 flag, the variable val.int_val is a
'long long int'. It appears the abs function on your system is defined for
'int' and 'long int'. You could probalby typecast the variable so that the
compiler uses the 'long int' version. Though depending of the size of 'long
int' on your system this could have an undesired effect. If 'long int' on
your system is 64bits wide though you should be ok.

You can try:

return new Val(abs((long int)val.int_val), TYPE_COUNT);

The other concern here is that this is a one function fix and your going to
run into this issue everytime you pass a 'long long int' to a function that
has defines for just 'int' and 'long int'.

If 'long int' is 64bits wide on your system, you might be better off editing
the bro header file util.h so that you redefine int64.


typedef long long int int64;

would become

typedef long int int64;


// Joel


On Tue, Apr 15, 2008 at 7:30 PM, Paul Schmehl <pauls at utdallas.edu> wrote:

> --On April 15, 2008 4:02:14 PM -0700 Vern Paxson <vern at icir.org> wrote:
>
> >> That did not fix the problem.
> >
> > Rats.  Well, this doesn't repreoduce for me (w/ g++ 4.0.1), so I'm
> > reduced to guessing.  The next thing I'd try is
> >
> >       return new Val(abs(bro_int_t(val.int_val)), TYPE_COUNT);
> >
> > but if that doesn't work, I'm not sure what next to try.
> >
> >               Vern
>
> Sadly, that did not work either.  I'm afraid I'm not a programmer, so all
> I can do is follow your lead.  For now I'll make that option is
> non-working and continue working on the update to the port.
>
> If anyone on the list has the same version of gcc and can test this and
> find a resolution, please post it to the list.  I'll include a patch in
> the port to fix it.
>
> Paul Schmehl (pauls at utdallas.edu)
> Senior Information Security Analyst
> The University of Texas at Dallas
> http://www.utdallas.edu/ir/security/
>
> _______________________________________________
>  Bro mailing list
> bro at bro-ids.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro<http://mailman.icsi.berkeley.edu/mailman/listinfo/bro>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20080415/49fea286/attachment.html 


More information about the Bro mailing list