On Sun, Jan 03, 2010 at 12:35:44AM +0300, anonymous wrote: > Something from gcc manpage: > > "It makes a difference where in the command you write this option; the > linker searches and processes libraries and object files in the order > they are specified. Thus, foo.o -lz bar.o searches library z after > file foo.o but before bar.o. If bar.o refers to functions in z, those > functions may not be loaded." > > "The linker handles an archive file by scanning through it for members > which define symbols that have so far been referenced but not > defined."
Hm, never noticed that behaviour before.. > If it works with the following I will push it into repository. > $(CC) -o $(PROG) $(OBJS) $(LDFLAGS) That does work. There are also some minor changes attached in order to remove warnings/notices from icc / gcc -Wextra. v4hn
diff -r 459d7656e0f3 network.c
--- a/network.c Sun Jan 03 00:47:34 2010 +0300
+++ b/network.c Sun Jan 03 02:07:32 2010 +0100
@@ -153,1 +153,1 @@
- return ~sum;
+ return (u_int16_t) ~sum;
diff -r 459d7656e0f3 parse.c
--- a/parse.c Sun Jan 03 00:47:34 2010 +0300
+++ b/parse.c Sun Jan 03 02:07:32 2010 +0100
@@ -64,1 +64,1 @@
-parsecidr(char *host, char *s, struct options *opts)
+parsecidr(char *hoststring, char *s, struct options *opts)
@@ -67,1 +67,1 @@
- struct sockaddr *sa = eresolve(host, AF_INET);
+ struct sockaddr *sa = eresolve(hoststring, AF_INET);
diff -r 459d7656e0f3 ports.c
--- a/ports.c Sun Jan 03 00:47:34 2010 +0300
+++ b/ports.c Sun Jan 03 02:07:32 2010 +0100
@@ -86,1 +86,1 @@
- port->portno = i;
+ port->portno = (in_port_t) i;
diff -r 459d7656e0f3 portscan.c
--- a/portscan.c Sun Jan 03 00:47:34 2010 +0300
+++ b/portscan.c Sun Jan 03 02:07:32 2010 +0100
@@ -140,1 +140,1 @@
- n = printf("%u/%s", port->portno, p_name);
+ n = printf("%hu/%s", port->portno, p_name);
@@ -233,1 +233,1 @@
- opts.netopts.ttl = strtol(optarg, NULL, 0);
+ opts.netopts.ttl = (u_int8_t) strtol(optarg, NULL, 0);
diff -r 459d7656e0f3 scan.c
--- a/scan.c Sun Jan 03 00:47:34 2010 +0300
+++ b/scan.c Sun Jan 03 02:07:32 2010 +0100
@@ -51,1 +51,1 @@
- int i;
+ unsigned int i;
@@ -134,1 +134,1 @@
- int portno = port->portno;
+ in_port_t portno = port->portno;
@@ -198,1 +198,1 @@
- int res = getsockopt(conn->sockfd, SOL_SOCKET,
SO_ERROR, &error, &len);
+ res = getsockopt(conn->sockfd, SOL_SOCKET, SO_ERROR,
&error, &len);
@@ -485,1 +485,1 @@
- struct port *port; /* !!! */
+ struct port *rcvport; /* !!! */
@@ -490,2 +490,2 @@
- port = connsearch(&head, pktp, &pool);
- if (port == NULL)
+ rcvport = connsearch(&head, pktp, &pool);
+ if (rcvport == NULL)
@@ -494,1 +494,1 @@
- port->state =
+ rcvport->state =
pgpfOYViZn1O2.pgp
Description: PGP signature
