Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building 4.0 on FreeBSD armv7 #3743

Closed
rbgarga opened this issue Apr 13, 2020 · 1 comment · Fixed by #3744
Closed

Error building 4.0 on FreeBSD armv7 #3743

rbgarga opened this issue Apr 13, 2020 · 1 comment · Fixed by #3744

Comments

@rbgarga
Copy link

rbgarga commented Apr 13, 2020

I was trying to build 4.0 version of ntopng on FreeBSD 12 armv7 (amd64 built with no issues) and got following error:

src/ParsedFlow.cpp:130:14: error: invalid operands to binary expression ('lua_Number' (aka 'double') and 'double')
          version = htons(lua_tonumber(L, -1));
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/netinet/in.h:120:18: note: expanded from macro 'htons'
#define htons(x)        __htons(x)
                        ^~~~~~~~~~
/usr/include/machine/endian.h:74:28: note: expanded from macro '__htons'
#define __htons(x)        (__bswap16(x))
                           ^~~~~~~~~~~~
/usr/include/machine/endian.h:129:6: note: expanded from macro '__bswap16'
     __bswap16_constant(x) :                    \
     ^~~~~~~~~~~~~~~~~~~~~
/usr/include/machine/endian.h:124:12: note: expanded from macro '__bswap16_constant'
    ((((x) & 0xff00) >> 8) |            \
       ~~~ ^ ~~~~~~
@rbgarga
Copy link
Author

rbgarga commented Apr 13, 2020

For instance, replacing lua_tonumber() by lua_tointeger() fixed the issue

madpilot78 added a commit to madpilot78/ntopng that referenced this issue Apr 13, 2020
…s more appropriate there.

Not sure why on FreeBSD armv7 it's causing an error, my best guess is that certain compiler/arch combinations refuse tu implicitly cast float to unsigned int.

Problem and patch reported and proposed by @rbgarga

This should fix ntop#3743
emanuele-f pushed a commit that referenced this issue Apr 15, 2020
…s more appropriate there.

Not sure why on FreeBSD armv7 it's causing an error, my best guess is that certain compiler/arch combinations refuse tu implicitly cast float to unsigned int.

Problem and patch reported and proposed by @rbgarga

This should fix #3743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant