Re: GCC problem
- From: Mike McGInn <mikemcginn@xxxxxxxxxxxxx>
- Date: Wed, 18 Jul 2007 10:31:23 GMT
On Wed, 18 Jul 2007 07:19:17 +0000, westymatt wrote:
I switched my code over to using what I believe to be the K&R style
function definitions.
63 /*pcap_loop callback routine*/
64 void
65 capture_callback(buffer, packet_header, data)
66 u_char *buffer, const struct pcap_pkthdr
*packet_header, u_char *data;
67 {
68 total_captured_packets++;
69 if (display == true)
70 {
71 fprintf(stdout, "Received packet %d\n");
72 }
73 if (cache_packets == true)
74 {
75 struct packetCache *pc;
76 if ((pc = malloc(sizeof *pc + packet_header->len)) ==
NULL)
77 {
78 fprintf(stderr, "Memory Allocation Error!\n");
79 fprintf(stderr, "Turning off caching\n");
80 cache_packets = false;
"packman.c" 230L, 5444C written
sysadmin@devbox:~/projects/packet_capture$ gcc -c packman.c
packman.c: In function âcapture_callbackâ:
packman.c:66: error: expected identifier or â(â before âconstâ
packman.c:76: error: invalid type argument of â->â
You should buy the second edition before doing that.
--
Mike McGinn
"more kidneys than eyes!"
.
- References:
- GCC problem
- From: westymatt
- GCC problem
- Prev by Date: Re: My program can't work on redhat enterprise AS 4
- Next by Date: Re: GCC problem
- Previous by thread: Re: GCC problem
- Next by thread: Re: GCC problem
- Index(es):
Relevant Pages
|