Git Product home page Git Product logo

dummynet-ipfw's Issues

Fix build on FreeBSD

make on FreeBSD terminates with following trace -
Note: gcc version 4.9.4

gmake
gmake[1]: Entering directory '/usr/home/zeebsd/source-codes/dummynet-ipfw'
Building userspace ...
gmake[2]: Entering directory '/usr/home/zeebsd/source-codes/dummynet-ipfw/ipfw'
   CC ipfw2.c
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:77:24: note: expanded from macro '__bswap32'
        (__builtin_constant_p(x) ?      \
                              ^
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:78:33: note: expanded from macro '__bswap32'
            __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
                                       ^
/usr/include/x86/endian.h:68:27: note: expanded from macro '__bswap32_gen'
        (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
                                 ^
/usr/include/x86/endian.h:74:37: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                                           ^
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:78:33: note: expanded from macro '__bswap32'
            __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
                                       ^
/usr/include/x86/endian.h:68:27: note: expanded from macro '__bswap32_gen'
        (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
                                 ^
/usr/include/x86/endian.h:75:33: note: expanded from macro '__bswap16'
            __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
                                       ^
/usr/include/x86/endian.h:66:40: note: expanded from macro '__bswap16_gen'
#define __bswap16_gen(x)        (__uint16_t)((x) << 8 | (x) >> 8)
                                              ^
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:78:33: note: expanded from macro '__bswap32'
            __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
                                       ^
/usr/include/x86/endian.h:68:27: note: expanded from macro '__bswap32_gen'
        (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
                                 ^
/usr/include/x86/endian.h:75:33: note: expanded from macro '__bswap16'
            __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
                                       ^
/usr/include/x86/endian.h:66:51: note: expanded from macro '__bswap16_gen'
#define __bswap16_gen(x)        (__uint16_t)((x) << 8 | (x) >> 8)
                                                         ^
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:78:33: note: expanded from macro '__bswap32'
            __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
                                       ^
/usr/include/x86/endian.h:68:60: note: expanded from macro '__bswap32_gen'
        (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
                                                                  ^
/usr/include/x86/endian.h:74:37: note: expanded from macro '__bswap16'
        ((__uint16_t)(__builtin_constant_p(x) ? \
                                           ^
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:78:33: note: expanded from macro '__bswap32'
            __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
                                       ^
/usr/include/x86/endian.h:68:60: note: expanded from macro '__bswap32_gen'
        (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
                                                                  ^
/usr/include/x86/endian.h:75:33: note: expanded from macro '__bswap16'
            __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
                                       ^
/usr/include/x86/endian.h:66:40: note: expanded from macro '__bswap16_gen'
#define __bswap16_gen(x)        (__uint16_t)((x) << 8 | (x) >> 8)
                                              ^
ipfw2.c:2856:19: error: shifting a negative signed value is undefined
      [-Werror,-Wshift-negative-value]
                d[1] = htonl(~0 << (32 - 24));
                             ~~ ^
/usr/include/netinet/in.h:117:26: note: expanded from macro 'htonl'
#define htonl(x)        __htonl(x)
                                ^
/usr/include/x86/endian.h:126:30: note: expanded from macro '__htonl'
#define __htonl(x)      __bswap32(x)
                                  ^
/usr/include/x86/endian.h:78:33: note: expanded from macro '__bswap32'
            __bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
                                       ^
/usr/include/x86/endian.h:68:60: note: expanded from macro '__bswap32_gen'
        (((__uint32_t)__bswap16((x) & 0xffff) << 16) | __bswap16((x) >> 16))
                                                                  ^
/usr/include/x86/endian.h:75:33: note: expanded from macro '__bswap16'
            __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
                                       ^
/usr/include/x86/endian.h:66:51: note: expanded from macro '__bswap16_gen'
#define __bswap16_gen(x)        (__uint16_t)((x) << 8 | (x) >> 8)
                                                         ^
7 errors generated.
gmake[2]: *** [../Makefile.inc:28: ipfw2.o] Error 1
gmake[2]: Leaving directory '/usr/home/zeebsd/source-codes/dummynet-ipfw/ipfw'
gmake[1]: *** [Makefile:17: ipfw] Error 2
gmake[1]: Leaving directory '/usr/home/zeebsd/source-codes/dummynet-ipfw'
*** Error code 2

Stop.
make: stopped in /usr/home/zeebsd/source-codes/dummynet-ipfw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.