I\'d like to do some stuffs before main function. I have multiple source files. In each file, there is some work that needs to be done before main.
(I know, this isn't a direct answer to the original question; it is, however, an answer for someone who's looking for a way to execute code before the contents of main)
I've heard of a better idea - one, that's even portable and predictable in behavior. Do the stuff you want to do "before main" in the beginning of the main function (or call a function which does what you want in the beginning of main).
If you control the code, there's (really!) no need for fragile and often unmaintainable hacks like the ones you have proposed (or introduced).