Re: [AD] got rid of END_OF_MAIN() |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Michael Benfield wrote:
This isn't what the patch I submitted does.
Hm, ok. I think, when you do a change like this, it's best to just do
what's necesarry to make the patch work. Having all that extra stuff in
the patch (doc changes, example changes, etc), IMO, is unnecessary until
you get conformation that the change will be accepted.. it saves you
time from having to do all the changes prematurely, and it save us time
from having to look through the patch to find where the actual/important
changes are. Most people look at the .diff itself to see what you're
changing so having a lot of extra stuff in it makes it harder to find
the real changes.
That said, I think your idea has some merit. Although I would probably
change the implemtation some. The big question I need to ask is: what
would happen if you forcibly pass arguments to a function that takes
(void)? Like this:
int main(int c, char **v, ect)
{
int (*main3)(int, char**,blah) = &_mangled_main;
return main3(c, v, etc);
}
What that would do is pass all three arguments, and hopefully if the the
actual declaration only has two or none, it'll only see two, or nothing.
Though I hope the CPU doesn't do something stupid and like, put the last
declaration first on the stack, which would screw up the technique.
Barring that, it's only a matter of getting the pointer to the function
without knowing the declaration (easy in C, though C++ would be a problem).
B. The author has a problem writing a main with argc and argv.
GCC will produce warnings about unused parameters with a proper warning
mode if argc and/or argv aren't used. And people do like to develop with
-Werror, which would make compilation fail outright.
- Kitty Cat