Ivan
Thu Apr 20 03:56:02 CDT 2006
The MS C-Runtime implementations offers features such as
- calling "atexit()" handlers in C++ applications (a `C` feature in C++)
- calling "unexpected" when an exception is not caught by
any exception list (a `C++` feature in `C`)
- cleanly allowing mscoree.dll to invoke Finalizers.
For example, feature #2 installs an UnHandledExceptionFilter,
that may be unwanted for those case where there are no exceptions.
But, the code would be not any more complex
(5-10 lines in the implementation) than the one that calls CorExitProcess
when necessary.
Writing a runtime that fits exactly and all the needs of a specific "domain"
would imply creating an un-necessary complication on the infrastrucutre.
Immagine linking a C++-but-not-C runtime, a CLR-but-not-C++ runtime,
a C-but-not-C++ runtime, and explaining people why certain feature
works (or do not work) as they would legitimately expect.
If it makes you feel better, since WinXp the NtDll-User-mode loader
has been modified to recognize the COR+2.0 images, so, even the
OS is CLR aware.
The code that possibly invokes CorExitProcess should never be more than
a few hundreds of bytes of compiled code.
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Frederico Pissarra" <me@nowhere.net> wrote in message
news:OTtXQ9DZGHA.4164@TK2MSFTNGP04.phx.gbl...
>
> "Tim Roberts" <timr@probo.com> wrote in message
> news:loib42191grjnec1dq8j9l1ahdbf0kl27e@4ax.com...
>> "Frederico Pissarra" <me@nowhere.net> wrote:
>>>
>>>Ivan, I got that... and my point is even if my app ever use any CLR
>>>resource
>>>I'm forced to have dead code in my apps... As I said before: I wonder
>>>what
>>>other surprises MS put in the compiler/libraries...
>>
>> Why are you worried about this? The run-time library also has code to
>> call
>> the destructors for all of your global C++ objects, even if your program
>> is
>> written in C. Do you consider that "surprising" dead code?
>> --
>> - Tim Roberts, timr@probo.com
>> Providenza & Boekelheide, Inc.
>
> The point is to have CLR dead code in a pure Win32 App...
>
> It's expected to have init/cleanup hidden code in every C/C++ app, but not
> "cross platform" dead code.
>
> []s
> Fred
>