INF:pascal Attribute for Multithread Function Returning Double

ID Number: Q37459

5.10 6.00 6.00a

OS/2

Summary:

In Microsoft C versions 5.1, 6.0, and 6.0a, an important requirement

for returning floating-point values from functions in a multithread

environment is defining and prototyping functions with the "pascal"

function attribute.

More Information:

When you use the pascal attribute on floating-point functions, the

floating-point return value is placed on the calling thread's stack,

providing each thread with its own return value as desired.

When using the default of the C function call/return convention

instead of pascal, we use a global variable __fac (floating-point

accumulator) for returning floating-point values. For multithread

applications or DLL's using CRTLIB.DLL, the global variable __fac

could be unintentionally modified by another thread, so it is not

contained in CRTEXE.OBJ, CRTDLL.OBJ, or CRTDLL.LIB. Consequently,

references to __fac will be unresolved at link time.

Additional reference words: 5.10 6.00 6.00a