PRB: Cannot Use /Zp Compiler Option with DB-LIBRARY

ID Number: Q37667

1.10 1.11 4.20

OS/2

Summary:

SYMPTOMS

DB-LIBRARY (db-lib) programs compiled with /Zp (pack structure

members) produce general protection (GP) faults and incorrect

results. The problem seems to be limited to db-lib macros such

as dbcurrow(), dbfirstrow(), and dbrowtype().

CAUSE

Db-lib has been compiled with default structure alignment. If the

user program is compiled with an incompatible pack option, db-lib

macros will be generated with incorrect offsets, resulting in

unpredictable results.

RESOLUTION

If the user program must be compiled with /Zp, the problem can

be circumvented by putting pragma statements around the include

for "sqldb" to force word alignment offsets to be generated when

db-lib macros reference that structure.

Additional reference words: dblib