By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,681 Members | 1,854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,681 IT Pros & Developers. It's quick & easy.

ping source code

P: n/a
I was reading through original source code of ping for some insight
and was confused by unusual code.

Entire listing available at:
http://www.ping127001.com/pingpage/ping.html

#include #include #include
#include #include #include #include
#include #include #include #include #include

What does this mean? That is all of the #include's there are.

main(argc, argv)
char *argv[];
{

That is how the main function starts. Is that legal?

There are structs that are network related that I don't know where
they come from because of the lack of any recongnizable #include file.
The code is well organized and commented. I understand that this
program is from 1982. Just for fun, I ran it through gcc and it
generated a lot of errors, many of which are due to the lack of
legitimate #includes. What does this all mean? Shouldn't the famous
Ping code compile with gcc?

Compile errors:

pg.c:2: error: parse error before "I"
pg.c:24:10: #include expects "FILENAME" or <FILENAME>
pg.c:25:10: #include expects "FILENAME" or <FILENAME>
pg.c:26:10: #include expects "FILENAME" or <FILENAME>
pg.c: In function `main':
pg.c:72: error: storage size of `from' isn't known
pg.c:82: error: `SO_DEBUG' undeclared (first use in this function)
pg.c:82: error: (Each undeclared identifier is reported only once
pg.c:82: error: for each function it appears in.)
pg.c:85: error: `SO_DONTROUTE' undeclared (first use in this function)
pg.c:104: error: invalid application of `sizeof' to an incomplete type
pg.c:105: error: dereferencing pointer to incomplete type
pg.c:105: error: `AF_INET' undeclared (first use in this function)
pg.c:106: error: dereferencing pointer to incomplete type
pg.c:107: error: dereferencing pointer to incomplete type
pg.c:111: warning: assignment makes pointer from integer without a
cast
pg.c:113: error: dereferencing pointer to incomplete type
pg.c:113: error: dereferencing pointer to incomplete type
pg.c:114: error: dereferencing pointer to incomplete type
pg.c:114: error: `caddr_t' undeclared (first use in this function)
pg.c:114: error: dereferencing pointer to incomplete type
pg.c:114: error: dereferencing pointer to incomplete type
pg.c:115: error: dereferencing pointer to incomplete type
pg.c:127: error: `stderr' undeclared (first use in this function)
pg.c:130: error: invalid application of `sizeof' to an incomplete type
pg.c:141: warning: assignment makes pointer from integer without a
cast
pg.c:141: error: `NULL' undeclared (first use in this function)
pg.c:146: error: `SOCK_RAW' undeclared (first use in this function)
pg.c:146: error: dereferencing pointer to incomplete type
pg.c:153: error: `SOL_SOCKET' undeclared (first use in this function)
pg.c:161: error: dereferencing pointer to incomplete type
pg.c:163: error: dereferencing pointer to incomplete type
pg.c:167: error: `stdout' undeclared (first use in this function)
pg.c:169: error: `SIGINT' undeclared (first use in this function)
pg.c:170: error: `SIGALRM' undeclared (first use in this function)
pg.c:180: error: `packet' undeclared (first use in this function)
pg.c:183: error: storage size of `timeout' isn't known
pg.c:195: error: `EINTR' undeclared (first use in this function)
pg.c: In function `catcher':
pg.c:232: error: `SIGALRM' undeclared (first use in this function)
pg.c: In function `pinger':
pg.c:248: error: syntax error before "outpack"
pg.c:249: error: `outpack' undeclared (first use in this function)
pg.c:252: error: syntax error before '*' token
pg.c:254: error: dereferencing pointer to incomplete type
pg.c:254: error: `ICMP_ECHO' undeclared (first use in this function)
pg.c:255: error: dereferencing pointer to incomplete type
pg.c:256: error: dereferencing pointer to incomplete type
pg.c:257: error: dereferencing pointer to incomplete type
pg.c:258: error: dereferencing pointer to incomplete type
pg.c:265: error: `iicmp_cksum' undeclared (first use in this function)
pg.c:268: error: invalid application of `sizeof' to an incomplete type
pg.c:268: error: parse error before ';' token
pg.c:274: error: `stdout' undeclared (first use in this function)
pg.c: At top level:
pg.c:276: error: parse error before "if"
pg.c:278: warning: parameter names (without types) in function
declaration
pg.c:278: warning: data definition has no type or storage class
pg.c:279: error: parse error before '}' token
pg.c: In function `pr_pack':
pg.c:332: error: `packet' undeclared (first use in this function)
pg.c:334: error: storage size of `tv' isn't known
pg.c:338: error: dereferencing pointer to incomplete type
pg.c:338: error: dereferencing pointer to incomplete type
pg.c:342: error: dereferencing pointer to incomplete type
pg.c:343: error: `ICMP_MINLEN' undeclared (first use in this function)
pg.c:346: error: dereferencing pointer to incomplete type
pg.c:351: error: dereferencing pointer to incomplete type
pg.c:351: error: `ICMP_ECHOREPLY' undeclared (first use in this
function)
pg.c:353: error: dereferencing pointer to incomplete type
pg.c:354: error: dereferencing pointer to incomplete type
pg.c:354: error: dereferencing pointer to incomplete type
pg.c:354: error: dereferencing pointer to incomplete type
pg.c:362: error: dereferencing pointer to incomplete type
pg.c:366: error: dereferencing pointer to incomplete type
pg.c:379: error: dereferencing pointer to incomplete type
pg.c:380: error: dereferencing pointer to incomplete type
pg.c:387: error: `stdout' undeclared (first use in this function)
pg.c: At top level:
pg.c:401: error: parse error before "u_short"
pg.c:401: warning: data definition has no type or storage class
pg.c:403: error: parse error before '{' token
pg.c:405: error: parse error before '*' token
pg.c:405: error: initializer element is not constant
pg.c:405: warning: data definition has no type or storage class
pg.c:406: error: parse error before "answer"
pg.c:406: warning: data definition has no type or storage class
pg.c:407: error: register name not specified for `sum'
pg.c:415: error: parse error before "while"
pg.c:424: error: parse error before '*' token
pg.c:431: error: redefinition of `sum'
pg.c:407: error: `sum' previously defined here
pg.c:431: error: initializer element is not constant
pg.c:431: warning: data definition has no type or storage class
pg.c:432: error: parse error before '+=' token
pg.c:433: error: initializer element is not constant
pg.c:433: warning: data definition has no type or storage class
pg.c:434: error: parse error before "return"
pg.c: In function `tvsub':
pg.c:447: error: dereferencing pointer to incomplete type
pg.c:447: error: dereferencing pointer to incomplete type
pg.c:448: error: dereferencing pointer to incomplete type
pg.c:449: error: dereferencing pointer to incomplete type
pg.c:451: error: dereferencing pointer to incomplete type
pg.c:451: error: dereferencing pointer to incomplete type
pg.c: In function `finish':
pg.c:466: error: `stdout' undeclared (first use in this function)
pg.c: At top level:
pg.c:42: error: storage size of `tz' isn't known
pg.c:44: error: storage size of `whereto' isn't known
Nov 14 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
wana <io*****@yahoo.com> scribbled the following:
I was reading through original source code of ping for some insight
and was confused by unusual code. Entire listing available at:
http://www.ping127001.com/pingpage/ping.html #include #include #include
#include #include #include #include
#include #include #include #include #include What does this mean? That is all of the #include's there are.
What the heck? I can't fathom out at all what that means. Either it is
a non-standard dialect or the source code is broken.
main(argc, argv)
char *argv[];
{ That is how the main function starts. Is that legal?
It used to be, not any more. That's a pre-standard K&R style. It's
still accepted by some compilers.
There are structs that are network related that I don't know where
they come from because of the lack of any recongnizable #include file.
The code is well organized and commented. I understand that this
program is from 1982. Just for fun, I ran it through gcc and it
generated a lot of errors, many of which are due to the lack of
legitimate #includes. What does this all mean? Shouldn't the famous
Ping code compile with gcc?


Not necessarily. C has changed a lot from 1982. gcc might have
abandoned support for some obsolete features.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Ice cream sales somehow cause drownings: both happen in summer."
- Antti Voipio & Arto Wikla
Nov 14 '05 #2

P: n/a
Joona I Palaste <pa*****@cc.helsinki.fi> scribbled the following:
wana <io*****@yahoo.com> scribbled the following:
I was reading through original source code of ping for some insight
and was confused by unusual code. Entire listing available at:
http://www.ping127001.com/pingpage/ping.html #include #include #include
#include #include #include #include
#include #include #include #include #include What does this mean? That is all of the #include's there are.
What the heck? I can't fathom out at all what that means. Either it is
a non-standard dialect or the source code is broken.


*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"How can we possibly use sex to get what we want? Sex IS what we want."
- Dr. Frasier Crane
Nov 14 '05 #3

P: n/a
"wana" <io*****@yahoo.com> wrote in message
news:bf**************************@posting.google.c om...
I was reading through original source code of ping for some insight
and was confused by unusual code.

Entire listing available at:
http://www.ping127001.com/pingpage/ping.html

#include #include #include
#include #include #include #include
#include #include #include #include #include

What does this mean? That is all of the #include's there are.
It means that the 'ping.html' file is not a properly
formatted HTML file. Try your browser's 'view source'
feature and copy/paste the code from there.

main(argc, argv)
char *argv[];
{

That is how the main function starts. Is that legal?
It's not standard C. It's the 'old style' function header.
Standard form is:

int main(int argc, char *argv[])

There are structs that are network related that I don't know where
they come from because of the lack of any recongnizable #include file.
See above about the #includes. But note that any networking
issues will will platform-specific, thus off-topic here.
The code is well organized and commented. I understand that this
program is from 1982.
Yes, the style is 'old'.
Just for fun, I ran it through gcc and it
generated a lot of errors, many of which are due to the lack of
legitimate #includes.

Then you need to fix the #includes, and disregard any other messages
which are very likly an artifact of the first error messages.
What does this all mean? Shouldn't the famous
Ping code compile with gcc?


Only if those nonstandard headers (and the libraries they
refer to) are provided and are compatible with gcc.

-Mike
Nov 14 '05 #4

P: n/a
wana <io*****@yahoo.com> wrote:
I was reading through original source code of ping for some insight
and was confused by unusual code. Entire listing available at:
http://www.ping127001.com/pingpage/ping.html #include #include #include
#include #include #include #include
#include #include #include #include #include What does this mean? That is all of the #include's there are.
That's simply broken code. Looks as if the required names of files
to be included are simply missing.
main(argc, argv)
char *argv[];
{ That is how the main function starts. Is that legal?
Yes, that's very old code (pre-C89) when C still used a different
method to declare function arguments. But modern compilers still
accept it, so it's not really a problem.
There are structs that are network related that I don't know where
they come from because of the lack of any recongnizable #include file.
That's highly likely. If you want to know where they come from ask
in e.g. comp.unix.programmer (or try to figure it out by yourself
by reading the man pages;-)
The code is well organized and commented. I understand that this
program is from 1982. Just for fun, I ran it through gcc and it
generated a lot of errors, many of which are due to the lack of
legitimate #includes. What does this all mean? Shouldn't the famous
Ping code compile with gcc?


No, definitely not without the missing files to be included.

Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #5

P: n/a
In article <bf**************************@posting.google.com >,
wana <io*****@yahoo.com> wrote:
I was reading through original source code of ping for some insight
and was confused by unusual code.

Entire listing available at:
http://www.ping127001.com/pingpage/ping.html

#include #include #include
#include #include #include #include
#include #include #include #include #include

What does this mean? That is all of the #include's there are.
Without going to the URL you posted, this looks like a poor HTMLization
of source code, where the <> in `#include <foo.h>' get treated as tags
(and, since the browser doesn't recognize them, silently ignored).

main(argc, argv)
char *argv[];
{

That is how the main function starts. Is that legal?
Yes, but it's outdated.
In K&R C, this was how arguments were declared: names only in the argument
list, and types (defaulting to int if not specified) given between the
function name/argument list and the beginning of the function body.

Except for prototype-based type checking if you call a function after
it's been declared like this, this declaration is equivalent to:
--------
int main(int argc, char *argv[])
--------
which is the preferred form for newly written code. C90 still allows
the older type of declaration; I'm not sure about C99 - implicit int is
gone, but I'm not sure (and don't have a strong enough desire to know
to actually look it up) whether
--------
int main(argc,argv)
int argc;
char *argv[];
{
/*function body here*/
}
--------
is still allowed.

There are structs that are network related that I don't know where
they come from because of the lack of any recongnizable #include file.
If you dig into the HTML source, I'd expect you'll find the names of the
headers (see above). Most of them are probably unixisms rather than ones
defined by the C language, so if you have questions about them you'd be
likely to get better answers from comp.unix.programmer .
The code is well organized and commented. I understand that this
program is from 1982. Just for fun, I ran it through gcc and it
generated a lot of errors, many of which are due to the lack of
legitimate #includes. What does this all mean? Shouldn't the famous
Ping code compile with gcc?


Possibly.

For one thing, what your browser is showing you is probably a mangled
version, not the original code. Also, the language has changed somewhat
since 1982, so a lot of what's in the code is no longer considered
good style, and it's quite possible that some of it is no longer legal.
(People who have worked with both K&R C and ANSI/ISO C will be better
able to comment on the differences.)
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
More and more often I wish I didn't know anything about the Internet so
things like this wouldn't disturb me so much.
--Steve VanDevender in the scary devil monastery
Nov 14 '05 #6

P: n/a
wana wrote:

I was reading through original source code of ping for some insight
and was confused by unusual code.

Entire listing available at:
http://www.ping127001.com/pingpage/ping.html

#include #include #include
#include #include #include #include
#include #include #include #include #include

What does this mean? That is all of the #include's there are.

[...]

Someone called a text file ".html". Look at the source to the page:

==========
[...]
#include <stdio.h>
#include <errno.h>
#include <sys/time.h>
[...]
==========

The brackets used by C are being misinterpreted by the browser as HTML
markups, due to the ".html" extension.

Ignore the browser's representation, view the source, and copy-paste that
instead.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #7

P: n/a
Joona I Palaste wrote:
[...]
*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.


Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+

Nov 14 '05 #8

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

wana wrote:
I was reading through original source code of ping for some insight
and was confused by unusual code.

Entire listing available at:
http://www.ping127001.com/pingpage/ping.html [snip] The code is well organized and commented. I understand that this
program is from 1982. Just for fun, I ran it through gcc and it
generated a lot of errors, many of which are due to the lack of
legitimate #includes. What does this all mean? Shouldn't the famous
Ping code compile with gcc?


Yes and no.

The late Mike Muus wrote ping for the original BSD sockets implementation, and
the source you found (a secondhand version, to be sure) isn't likely to be
compatable to the library implementations on your much more current system.
Assuming that you take the time to update the constants and syscalls to your
system's requirements, gcc should be able to compile the K&R C that Mike's
code is written in. It should even run.

If you want to read Mike's "The Story of the Ping program" and retrieve the
shar (shell archive - a unix shell script that self-unpacks the source code,
make files, and man pages), take a look at http://ftp.arl.mil/~mike/ping.html

I had the pleasure of having a short conversation with Mike a year or so
before he passed away.

- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBSieHagVFX4UWr64RAkEMAJ9diePJA6uWGGfYtexdjN YGWet4PACcCrUK
WbxEhW0m7s2xfdgNREwXomE=
=iZeK
-----END PGP SIGNATURE-----
Nov 14 '05 #9

P: n/a
Jens--

ping

--Jens
Nov 14 '05 #10

P: n/a
Kenneth Brody <ke******@spamcop.net> scribbled the following:
Joona I Palaste wrote:
[...]
*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.
Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.


Browsers are told how to display the content by a Content-Type header,
not by a file extension. At least Mozilla should be. I haven't checked
the Content-Type header on this page yet, though.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Life without ostriches is like coffee with milk."
- Mika P. Nieminen
Nov 14 '05 #11

P: n/a
Kenneth Brody <ke******@spamcop.net> scribbled the following:
Joona I Palaste wrote:
[...]
*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.
Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.


By "the idiot hosting the web server" I actually meant the idiot who
wrote that web page and uploaded it on the server, not the person or
people who operate the server itself. My apologies for being so
confusing, it was late at night and I was drunk.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Shh! The maestro is decomposing!"
- Gary Larson
Nov 14 '05 #12

P: n/a
In article <ci**********@oravannahka.helsinki.fi>,
Joona I Palaste <pa*****@cc.helsinki.fi> wrote:
Kenneth Brody <ke******@spamcop.net> scribbled the following:
Joona I Palaste wrote:
[...]
*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.

Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.


Browsers are told how to display the content by a Content-Type header,
not by a file extension. At least Mozilla should be. I haven't checked
the Content-Type header on this page yet, though.


--------
dj3vande@perpugilliam:~ (0) $ lynx -dump -head http://www.ping127001.com/pingpage/ping.html | grep 'Content-Type'
Content-Type: text/html
dj3vande@perpugilliam:~ (0) $
--------
So the swerver is believing whoever put the file there when they said
it was HTML.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
More and more often I wish I didn't know anything about the Internet so
things like this wouldn't disturb me so much.
--Steve VanDevender in the scary devil monastery
Nov 14 '05 #13

P: n/a
Kenneth Brody <ke******@spamcop.net> writes:
Joona I Palaste wrote:
[...]
*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.


Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.


The first line of the html file is a "<pre>" directive. Apparently
the author mistakenly thought that a "<pre>" directive inhibits
special treatment of '<' characters (and didn't bother to check
how the pages is displayed).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #14

P: n/a
Joona I Palaste wrote:

Kenneth Brody <ke******@spamcop.net> scribbled the following:
Joona I Palaste wrote:
[...]
*NOW* I understand. It actually reads
#include <foo.h>
#include <bar.h>
#include <quux.h>
#include <quuux.h>
(replace the silly names with proper ones)
but because the idiot hosting the web server is serving the page as
HTML instead of plain text, the web browser is filtering the header
names away, thinking they're non-standard HMTL tags.

Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.


Browsers are told how to display the content by a Content-Type header,
not by a file extension. At least Mozilla should be. I haven't checked
the Content-Type header on this page yet, though.


And the server typically determine the Content-Type by the extension.
(Unless it's script-generate, in which case the script generates the
Content-Type header.) Once again, it's the ".html" extension put there
by the person who put the file there. The server is doing what it was
told -- send it as HTML.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #15

P: n/a
Keith Thompson wrote:
[...]
Don't blame "the idiot hosting the web server", blame "the idiot who
decided to use a '.html' extension on a plain text file". It's your
browser "filtering the header names away", not the server, and it's
doing it because it was told to do so.


The first line of the html file is a "<pre>" directive. Apparently
the author mistakenly thought that a "<pre>" directive inhibits
special treatment of '<' characters (and didn't bother to check
how the pages is displayed).


Not to mention the lack of <HTML>, <BODY>, </PRE>, </BODY>, and </HTML>.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+

Nov 14 '05 #16

P: n/a
Keith Thompson <ks***@mib.org> writes:
[...]
The first line of the html file is a "<pre>" directive. Apparently
the author mistakenly thought that a "<pre>" directive inhibits
special treatment of '<' characters (and didn't bother to check
how the pages is displayed).


I really need to proofread better before I post. That should be "how
the *page* is displayed".

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #17

P: n/a
Groovy hepcat Joona I Palaste was jivin' on 16 Sep 2004 19:53:00 GMT
in comp.lang.c.
Re: ping source code's a cool scene! Dig it!
wana <io*****@yahoo.com> scribbled the following:
main(argc, argv)
char *argv[];
{

That is how the main function starts. Is that legal?


It used to be, not any more. That's a pre-standard K&R style. It's
still accepted by some compilers.


Actually, Joona, apart from the lack of a return type required by
C99, this is perfectly legal code. Old K&R style declarations are
still legal (though obsolescent).

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Nov 14 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.