file seek is slow

Tim Roberts timr at probo.com
Wed Mar 10 02:08:48 EST 2010


Metalone <jcb at iteris.com> wrote:
>
>static void main(int argc, char *argv[])

As a side note, do you realize that this definition is invalid, in two
ways?  "main" cannot be declared "static".  The whole reason we use the
special name "main" is so that the startup code in the C run-time can link
to it.  If "main" is static, it won't be exposed in the object file, and
the linker couldn't find it.  It happens to work here because your C
compiler knows about "main" and discards the "static", but that's not a
good practice.

Further, it's not valid to have "main" return "void".  The standards
require that it be declared as returning "int".  Again, "void" happens to
work in VC++, but there are architectures where it does not.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list