Ansicht
Dokumentation
Tip-No.: 38 ( INFO38 )
Storage class specifier SAP_VOLATILE missing
Tip-No.: 38
( INFO38 )
Addresses (Business Address Services)
General Data in Customer Master
This documentation is copyright by SAP AG.
Short text
Storage class specifier SAP_VOLATILE missing
Tip-No.: 38
Symptom
For declaring variables in pointers to shared memory areas, an attribute
for storage class "volatile" is missing. This is expected by
ANSI-C compilers, but not understood by K&R compilers.
Cause
In shared memory, variables can change without the compiler "knowing"
it. The compiler then feels authorized (according to ANSI standards)
to optimize away "unchanged" variables or hold them in registers.
Therefore, a #define should be included in saptype.h, which allows
the declaration of corresponding variables or pointers for both types
of compilers:
#define SAP_VOLATILE volatile for ANSI-C
#define SAP_VOLATILE /*nix*/ ffor K&R
Solution
In saptypeb.h, the following defines are contained:
SAP_VOLATILE, is activated with define SAPwithANSI_VOLATILE
SAP_CONST, is activated with define SAPwithANSI_CONST
The defines to be activated are contained as comments in typexxxx.h
of the corresponding target system (e.g. typemips.h). For mips and
hp9000, activating is not yet possible.
Vendor Master (General Section) Vendor Master (General Section)
This documentation is copyright by SAP AG.
Length: 1277 Date: 20240420 Time: 153758 sap01-206 ( 14 ms )