home *** CD-ROM | disk | FTP | other *** search
- In article <403@longway.TIC.COM> uunet!dg-rtp.dg.com!dg-rtp!meissner (Michael Meissner) writes:
- >| In article <401@longway.TIC.COM>, gwyn@BRL.MIL quotes someone:
- >| > >3) that the final version be
- >| > > b) portable to ALL UNIX SYSTEMS
- >| and then says ..
- >| > Wow, taken literally this would be EXTREMELY TOUGH.
- >| [yet another contestant's entry here]
- >You still lose. Under ANSI C the above program is not valid, since
- >printf is a varargs function that has no prototype in scope. While we
- >are at it, main should return a valid exit status. Ok, the revised
- >program is:
- > #include <stdio.h>
- > main()
- > {
- > printf("Hello world\n");
- > return 0;
- > }
-
- UNIX systems are not general ANSI C conforming at present.
- Some of them may not even support main() with no parameters..
- I know that some of them ignore the value retuned by main()
- and pretend it returned "success" status (0), but that doesn't
- break the above program.
-
- Certainly, back in prehistory, some UNIX systems did not have
- <stdio.h>. One would hope there are none like that still in
- operation, but I wouldn't bet on it.
-
- What Mike says is correct in the context of Standard C.
-
- If there is this much variation possible simply in the UNIX
- portability of the "Hello, world" program, imagine how much
- more difficult it would be for a GRAPHICS program (as in the
- original specification). By the way, we all understand the
- "graphics" requirement to not be satisfied by a text-oriented
- program.
-
- Volume-Number: Volume 17, Number 34
-
-
-