tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] cleanups


From: Carlos Montiers
Subject: Re: [Tinycc-devel] cleanups
Date: Sat, 18 Feb 2017 15:51:04 -0300

I think the assumption of it will not fail is incorrect. Because the function have a return value, and other crt check the return value. The main program cannot run if was some wrong getting the main args. I think is a little not serious continue without check the result error getting the main args.
When I did tests I found the only one possible reason for fails is not heap memory available.
If a program for example work with a file, ¿what will happen if the main args was getting incorrectly? it can do wrong thinks or damage the woriking files.
I suggest is better check the result of __getmainargs.

Carlos.

2016-10-04 13:50 GMT-03:00 grischka <address@hidden>:
Carlos Montiers wrote:
Why in win32/lib/crt1.c the code for check success of __getmainargs was removed?
I think is important check the return of that function before call to main.

There is no need to check if we assume that it cannot fail.
Machines are all based on assumptions, not, say, probabilities.
(Maybe this will change in future but then not at first in
compilers.)

-- gr

Carlos Montiers A.


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]