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

make fail on FreeBSD: netinet headers #27

Open
jungle-boogie opened this issue Apr 9, 2016 · 2 comments
Open

make fail on FreeBSD: netinet headers #27

jungle-boogie opened this issue Apr 9, 2016 · 2 comments

Comments

@jungle-boogie
Copy link

Hello,

Got a not-so-pretty build fail on freebsd 10.3 w.r.t. header files:

% make
Making all in src
make  all-am
gcc -DHAVE_CONFIG_H -I.      -g -O2 -MT ipreasm.o -MD -MP -MF .deps/ipreasm.Tpo -c -o ipreasm.o ipreasm.c
In file included from ipreasm.c:17:0:
/usr/include/netinet/ip.h:51:2: error: unknown type name 'u_char'
  u_char ip_hl:4,  /* header length */
  ^
/usr/include/netinet/ip.h:55:2: error: unknown type name 'u_char'
  u_char ip_v:4,   /* version */
  ^
/usr/include/netinet/ip.h:58:2: error: unknown type name 'u_char'
  u_char ip_tos;   /* type of service */
  ^
/usr/include/netinet/ip.h:59:2: error: unknown type name 'u_short'
  u_short ip_len;   /* total length */
  ^
/usr/include/netinet/ip.h:60:2: error: unknown type name 'u_short'
  u_short ip_id;   /* identification */
  ^
/usr/include/netinet/ip.h:61:2: error: unknown type name 'u_short'
  u_short ip_off;   /* fragment offset field */
  ^
/usr/include/netinet/ip.h:66:2: error: unknown type name 'u_char'
  u_char ip_ttl;   /* time to live */
  ^
/usr/include/netinet/ip.h:67:2: error: unknown type name 'u_char'
  u_char ip_p;   /* protocol */
  ^
/usr/include/netinet/ip.h:68:2: error: unknown type name 'u_short'
  u_short ip_sum;   /* checksum */
  ^
/usr/include/netinet/ip.h:69:17: error: field 'ip_src' has incomplete type
  struct in_addr ip_src,ip_dst; /* source and dest address */
                 ^
/usr/include/netinet/ip.h:69:24: error: field 'ip_dst' has incomplete type
  struct in_addr ip_src,ip_dst; /* source and dest address */
                        ^
/usr/include/netinet/ip.h:55:9: error: duplicate member 'ip_v'
  u_char ip_v:4,   /* version */
         ^
/usr/include/netinet/ip.h:56:3: error: duplicate member 'ip_hl'
   ip_hl:4;  /* header length */
   ^
/usr/include/netinet/ip.h:166:2: error: unknown type name 'u_char'
  u_char ipt_code;  /* IPOPT_TS */
  ^
/usr/include/netinet/ip.h:167:2: error: unknown type name 'u_char'
  u_char ipt_len;  /* size of structure (variable) */
  ^
/usr/include/netinet/ip.h:168:2: error: unknown type name 'u_char'
  u_char ipt_ptr;  /* index of current entry */
  ^
/usr/include/netinet/ip.h:170:2: error: unknown type name 'u_char'
  u_char ipt_flg:4,  /* flags, see below */
  ^
/usr/include/netinet/ip.h:174:2: error: unknown type name 'u_char'
  u_char ipt_oflw:4,  /* overflow counter */
/usr/include/netinet/ip.h:178:3: error: unknown type name 'uint32_t'
   uint32_t ipt_time[1]; /* network format */
   ^
/usr/include/netinet/ip.h:180:19: error: field 'ipt_addr' has incomplete type
    struct in_addr ipt_addr;
                   ^
/usr/include/netinet/ip.h:181:4: error: unknown type name 'uint32_t'
    uint32_t ipt_time; /* network format */
    ^
/usr/include/netinet/ip.h:174:9: error: duplicate member 'ipt_oflw'
  u_char ipt_oflw:4,  /* overflow counter */
         ^
/usr/include/netinet/ip.h:175:3: error: duplicate member 'ipt_flg'
   ipt_flg:4;  /* flags, see below */
   ^
/usr/include/netinet/ip.h:215:17: error: field 'ippseudo_src' has incomplete type
  struct in_addr ippseudo_src; /* source internet address */
                 ^
/usr/include/netinet/ip.h:216:17: error: field 'ippseudo_dst' has incomplete type
  struct in_addr ippseudo_dst; /* destination internet address */
                 ^
/usr/include/netinet/ip.h:217:2: error: unknown type name 'u_char'
  u_char  ippseudo_pad; /* pad, must be zero */
  ^
/usr/include/netinet/ip.h:218:2: error: unknown type name 'u_char'
  u_char  ippseudo_p; /* protocol */
  ^
/usr/include/netinet/ip.h:219:2: error: unknown type name 'u_short'
  u_short  ippseudo_len; /* protocol length */
  ^
In file included from ipreasm.c:18:0:
/usr/include/netinet/udp.h:42:2: error: unknown type name 'u_short'
  u_short uh_sport;  /* source port */
  ^
/usr/include/netinet/udp.h:43:2: error: unknown type name 'u_short'
  u_short uh_dport;  /* destination port */
  ^
/usr/include/netinet/udp.h:44:2: error: unknown type name 'u_short'
  u_short uh_ulen;  /* udp length */
  ^
/usr/include/netinet/udp.h:45:2: error: unknown type name 'u_short'
  u_short uh_sum;   /* udp checksum */
  ^
*** Error code 1
@jungle-boogie
Copy link
Author

Still failing with freebsd 11-release.

config options:

ipgrep 2.2.1

Build directory............. :
Installation prefix......... : /usr/local
IPv6 support.................: yes
HEP support................. : yes
HEP Compression............. : no
SSL/TLS..................... : no
Ncurses support............. : yes

Build with REDIS............ : no
Build with PCRE............. : yes

fail log

% make
Making all in src
make  all-am
cc -DHAVE_CONFIG_H -I.      -I/usr/include -I/usr/local/include -MT sipgrep.o -MD -MP -MF .deps/sipgrep.Tpo -c -o sipgrep.o sipgrep.c
sipgrep.c:1452:38: warning: '&&' within '||' [-Wlogical-op-parentheses]
                if (local_match == 1 && !invert_match || local_match != invert_match)
                    ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ ~~
sipgrep.c:1452:38: note: place parentheses around the '&&' expression to silence this warning
                if (local_match == 1 && !invert_match || local_match != invert_match)
                                     ^
                    (                                )
sipgrep.c:1573:38: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            if(light_parse_message ( d, remaining_bytes, &bytes_parsed) == 1)
                                     ^
./include/sipparse.h:133:31: note: passing argument to parameter 'message' here
int light_parse_message(char *message, unsigned int blen, unsigned int* bytes_parsed);
                              ^
sipgrep.c:1715:18: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
          else if ((pch = strchr ((const char*) s, ' ')) != NULL) {
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1730:10: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            pch = strstr ((char *)s, ";tag=");
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1738:10: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            pch = strstr ((char *)s, ";tag=");
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1746:10: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            pch = strstr ((char *)s, "branch=");
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1749:12: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
              pca = strchr ((char *)pch, ';');
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
sipgrep.c:1752:7: warning: assigning to 'const unsigned char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                pca = strchr ((char *)pch, '\n');
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
8 warnings generated.
mv -f .deps/sipgrep.Tpo .deps/sipgrep.Po
cc -DHAVE_CONFIG_H -I.      -I/usr/include -I/usr/local/include -MT log.o -MD -MP -MF .deps/log.Tpo -c -o log.o log.c
mv -f .deps/log.Tpo .deps/log.Po
cc -DHAVE_CONFIG_H -I.      -I/usr/include -I/usr/local/include -MT ipreasm.o -MD -MP -MF .deps/ipreasm.Tpo -c -o ipreasm.o ipreasm.c
In file included from ipreasm.c:17:
/usr/include/netinet/ip.h:51:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_hl:4,                /* header length */
        ^
/usr/include/netinet/ip.h:55:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_v:4,                 /* version */
        ^
/usr/include/netinet/ip.h:55:9: error: duplicate member 'ip_v'
        u_char  ip_v:4,                 /* version */
                ^
/usr/include/netinet/ip.h:52:3: note: previous declaration is here
                ip_v:4;                 /* version */
                ^
/usr/include/netinet/ip.h:56:3: error: duplicate member 'ip_hl'
                ip_hl:4;                /* header length */
                ^
/usr/include/netinet/ip.h:51:9: note: previous declaration is here
        u_char  ip_hl:4,                /* header length */
                ^
/usr/include/netinet/ip.h:58:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_tos;                 /* type of service */
        ^
/usr/include/netinet/ip.h:59:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_len;                 /* total length */
        ^
/usr/include/netinet/ip.h:60:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_id;                  /* identification */
        ^
/usr/include/netinet/ip.h:61:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_off;                 /* fragment offset field */
        ^
/usr/include/netinet/ip.h:66:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_ttl;                 /* time to live */
        ^
/usr/include/netinet/ip.h:67:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ip_p;                   /* protocol */
        ^
/usr/include/netinet/ip.h:68:2: error: unknown type name 'u_short'; did you mean 'short'?
        u_short ip_sum;                 /* checksum */
        ^
/usr/include/netinet/ip.h:69:17: error: field has incomplete type 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                        ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:69:24: error: field has incomplete type 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                               ^
/usr/include/netinet/ip.h:69:9: note: forward declaration of 'struct in_addr'
        struct  in_addr ip_src,ip_dst;  /* source and dest address */
                ^
/usr/include/netinet/ip.h:167:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_code;               /* IPOPT_TS */
        ^
/usr/include/netinet/ip.h:168:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_len;                /* size of structure (variable) */
        ^
/usr/include/netinet/ip.h:169:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_ptr;                /* index of current entry */
        ^
/usr/include/netinet/ip.h:171:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_flg:4,              /* flags, see below */
        ^
/usr/include/netinet/ip.h:175:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  ipt_oflw:4,             /* overflow counter */
        ^
/usr/include/netinet/ip.h:175:9: error: duplicate member 'ipt_oflw'
        u_char  ipt_oflw:4,             /* overflow counter */
                ^
/usr/include/netinet/ip.h:172:3: note: previous declaration is here
                ipt_oflw:4;             /* overflow counter */
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/user/bin/sipgrep/src
*** Error code 1

Stop.
make[1]: stopped in /usr/home/user/bin/sipgrep/src
*** Error code 1

Stop.
make: stopped in /usr/home/user/bin/sipgrep

@jungle-boogie
Copy link
Author

% cc -v
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: i386-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/bin

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

No branches or pull requests

1 participant