Re: GCC problem
- From: Gil Hamilton <gil_hamilton@xxxxxxxxxxx>
- Date: Wed, 18 Jul 2007 13:16:55 +0200 (CEST)
westymatt <westymatt@xxxxxxxxx> wrote in news:1184743157.214777.263570
@z28g2000prd.googlegroups.com:
I switched my code over to using what I believe to be the K&R style
function definitions.
As others have already noted, that's not a terribly sane thing to do. I
really can't imagine why you would want to do so. However gcc will still
happily accept the code if you give it proper K&R syntax.
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;
The function arguments should be separated by semicolons:
void capture_callback(buffer, packet_header, data)
u_char *buffer;
const struct pcap_pkthdr *packet_header;
u_char *data;
{
/* function body */
}
Also, you should know that the keywords "const" and "void" did not exist
back in original K&R days.
GH
.
- References:
- GCC problem
- From: westymatt
- GCC problem
- Prev by Date: Re: GCC problem
- Next by Date: How to set timezone
- Previous by thread: Re: GCC problem
- Next by thread: How to set timezone
- Index(es):
Relevant Pages
|
|