pradeep tumati <ptumati@yahoo.com> wrote:>> I think you need to look for non-C compilers for this? If a compiler>> encounters a C function, it can't be sure it is not exported via a>> header somewhere, and those headers expect standard C calling>> conventions.>>Most C compiler try following the standard ABI specifications of the>target processor. Now, if a compiler optimizes the function call>conventions, its not going to be sure if the callee is a library>function. So, its better to follow the starndard conventions.

That applies to Unix and derived systems (including Microsoft ones),
where C is the definition language for the system call API. On a
system where it is not, such as IBM MVS, the converse applies. The C
calling conventions on that are legion, weird and VERY much unlike the
standard calling sequence in almost all cases!

>Does this case even apply to parameter passing in the case of static>functions (in C)? Logically, we can perform optimization, but I am not>sure what kind of side effects this causes... The same can be the case>with functions calling other functions within the same C++ Namespace.

What's a static function in this context?

>There could be a scenario where this kind of optimization can be>entrusted to the linker, but I guess its going to be a costly>stuff. Any thoughts...?