J
Joona I Palaste
Bob Hairgrove <[email protected]> scribbled the following
I am not sure about this, but if the C and C++ standards say that is
valid C code, then they also specify a reasonable behaviour for it.
AFAIK not returning anything from main() is the same as returning 0.
The standards certainly don't specify anything about all this "EAX"
rubbish you're on about.
--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Last year he disrespected me - and then he showed lack of respect."
- Anthony Mason
Yes, but the trouble is how returning an "int" is usually implemented
in assembler (on Intel platforms, at least): the value in the EAX
register is read as the returned value.
If you don't specify a return value, EAX could contain anything at
all. If the calling process doesn't expect a return value, then it's
OK, but do you always know who (or what) will call your program?
I am not sure about this, but if the C and C++ standards say that is
valid C code, then they also specify a reasonable behaviour for it.
AFAIK not returning anything from main() is the same as returning 0.
The standards certainly don't specify anything about all this "EAX"
rubbish you're on about.
--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Last year he disrespected me - and then he showed lack of respect."
- Anthony Mason