PRB: Title #pragma in Include File Disables Further #pragmas

ID Number: Q33900

5.10 6.00 6.00a 6.00ax | 5.10 6.00 6.00a

MS-DOS | OS/2

buglist5.10 buglist6.00 buglist6.00a buglist6.00ax buglist7.00

Summary:

SYMPTOMS

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0,

if you use the #pragma title("text") feature in an include file, it

does not work correctly and any further #pragmas (for example, title,

page, and so on) in the main file are ignored. The "Microsoft C

Optimizing Compiler for MS OS/2 and MS-DOS Operating Systems: Version

5.1 Update" manual does not disallow this use.

RESOLUTION

You can work around the problem by using the #pragma feature

before the #include line.

STATUS

Microsoft has confirmed this to be a problem in versions 5.1, 6.0,

6.0a, 6.0ax, and C/C++ version 7.0 of the C compiler. We are

researching this problem and will post new information here as it

becomes available.

More Information:

Sample Code 1

-------------

/* Compile options needed: /Fs for source listing */

/* PRAGMA.C */

#pragma title("main program #1")

#pragma page()

#include "pragma.inc"

#pragma page()

#pragma title("main program #2")

#pragma page()

main ()

{

while (1);

}

Sample Code 2

-------------

/* PRAGMA.INC : */

/* The next two title will not appear in the source listing.

Comment out these two lines to see the difference in PRAGMA.LST */

#pragma title("include file #1")

#pragma page()

int file (void)

{

i=j;

return (i);

}

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00