[Bro] Problems compiling with --enable-int64
pauls at utdallas.edu
Tue Apr 15 19:07:28 PDT 2008
--On April 15, 2008 7:54:44 PM -0600 Joel Ebrahimi
<joel.ebrahimi at gmail.com> wrote:
> 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;
Thanks, Joel. This seems to point to a bigger problem. This software
could be installed on any FreeBSD system, from an older OS to a brand new
one, from i386 to amd to solaris. So, it's seems this is a situation that
would call for an #ifdef, would it not?
I don't know the size of a long int on my system, but I'm almost certain
that it won't be the same on *every* system.
Paul Schmehl (pauls at utdallas.edu)
Senior Information Security Analyst
The University of Texas at Dallas
More information about the Bro