tcpdump mailing list archives
Re: additional HP-UX 11.11 HP ANSI C triggered cleanup.
From: Guy Harris <guy () alum mit edu>
Date: Wed, 21 Jul 2004 15:03:40 -0700
On Jul 21, 2004, at 2:16 PM, Rick Jones wrote:
First was print-esp.c - it was warning in three places about an integer being converted to a pointer with the return value of strsep. There is no strsep in HP-UX, and it seems that interface.h deals with that, but print-esp.c was not including interface.h.
Actually, the problem there is that "netdissect.h" wasn't doing the same conditional declaration of "strsep()" that "interface.h" was; I checked in a change to do that (and fix some other not-up-to-date stuff in "netdissect.h").
This leaves one warning behind, that I've not fixed:cc -O -DHAVE_CONFIG_H -I./../libpcap -I/usr/local/include -I/usr//include -I./missing -D_U_="" -I. -I./../libpcap -I/usr/local/include -I/usr//include -I./missing -c ./print-esp.c cc: "print-esp.c", line 482: warning 604: Pointers are not assignment-compatible. cc: "print-esp.c", line 482: warning 563: Argument #3 is not the correct type.which seems to be this call to EVP_CipherInit: if (sa->evp) { memset(&ctx, 0, sizeof(ctx)); if (EVP_CipherInit(&ctx, sa->evp, secret, NULL, 0) < 0) (*ndo->ndo_warning)(ndo, "espkey init failed"); blocksz = EVP_CIPHER_CTX_block_size(&ctx);
That *might* be a change in the OpenSSL (or whatever library/library set that comes from) API between versions.
The next warning was a type mismatch in print-radius.c:
I've checked that fix in.
the next is print-rsvp.c, which is another char * versus u_char * thing:$ diff print-rsvp.c ../tcpdump-2004.07.20/print-rsvp.c 1383c1383< if (rsvp_obj_print(subtptr,(u_char *)"\n\t ", subtlen) == -1)--- > if (rsvp_obj_print(subtptr,"\n\t ", subtlen) == -1) 1403c1403 < if (rsvp_obj_print(tptr,(u_char *)"\n\t ", tlen) == -1) --- > if (rsvp_obj_print(tptr,"\n\t ", tlen) == -1)
Actually, the problem there is that the second argument to "rsvp_obj_print()" should be a "const char *" - it's just a string used as a tag in the output, not a pointer to packet data. I've checked in a change to do that.
next is another char * versus u_char * in print-telnet.c:
That's another case where a string argument should be "const char *"...
and then more of the same in tcpdump.c.
...and the same applies there. I've checked in changes to change the first argument to "ascii_print_with_offset()", "ascii_print()", "hex_print_with_offset()", and "hex_print()" from "const u_char *" to "const char *".
That also had an issue with redeclarations of ndo_error and ndo_warning with a different storage class specifier. I wasn't quite sure what to do about that:
Dissectors using the new "netdissect" stuff (currently only the ESP dissector; the intent is to make a library out of the dissection code) will call those routines through a pointer in a "struct netdissect_options"; those functions should be static. I've checked in a change to do that.
nor the empty declaration warning.
That's probably just a stray semicolon; the change I checked in also deleted that.
util.c had another char vs u_char:
...which should also be fixed by my "hex_print()" change.
so, after a make clean, a make -k gives this:
Cool. Sun C and your Alpha C compiler would probably pick up other issues; I don't have access to them any more, though.
- This is the tcpdump-workers list. Visit https://lists.sandelman.ca/ to unsubscribe.
Current thread:
- additional HP-UX 11.11 HP ANSI C triggered cleanup. Rick Jones (Jul 21)
- Re: additional HP-UX 11.11 HP ANSI C triggered cleanup. Guy Harris (Jul 21)
- Re: additional HP-UX 11.11 HP ANSI C triggered cleanup. Guy Harris (Jul 21)
- Re: additional HP-UX 11.11 HP ANSI C triggered cleanup. Guy Harris (Jul 21)