[Gllug] data segment vs stack

Rich Walker rw at shadow.org.uk
Wed Feb 15 01:50:41 UTC 2006


Nix <nix at esperi.org.uk> writes:

> On Tue, 14 Feb 2006, Christian Smith announced authoritatively:
>> main() is just a function like any other C function
>
> Pedant point: not quite. It may have uniquely weird calling conventions,
> stack alignment requirements, and so on, although this should be
> invisible from within the program.
>
> One difference between C and C++ is that in C++ you aren't allowed to
> call main() recursively (which presumably also applies to calling it
> from C in a mixed-language program). However, only obfuscated C code
> contests ever do things like that anyway.
>

also, in any interesting environment, you can expect that there are
functions you can't call from main.

mind you, in any interesting environment, you're using C because it
generates the assembler you want...



-- 
rich walker         |  Shadow Robot Company | rw at shadow.org.uk
technical director     251 Liverpool Road   |
need a Hand?           London  N1 1LX       | +UK 20 7700 2487
www.shadow.org.uk/products/newhand.shtml
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list