User`s guide

Pragmas for the DSP56800 and DSP56800E
Pragma Reference
384
Targeting MC56F83xx/DSP5685x Controllers
Prototype
#pragma dont_reuse_strings on | off | reset
Remarks
If you enable this pragma, the compiler stores each string literal separately. Otherwise,
the compiler stores only one copy of identical string literals. This pragma helps you
save memory if your program contains a lot of identical string literals that you do not
modify.
For example, take this code segment:
char *str1="Hello";
char *str2="Hello";
*str2 = 'Y';
If you enable this pragma, str1 is "Hello", and str2 is "Yello". Otherwise,
both str1 and str2 are "Yello".
This pragma corresponds to the Reuse Strings setting in the C/C++ Language
panel.
To check this setting, use __option (dont_reuse_strings), described in
Checking Settings
. By default, this pragma is disabled.
enumsalwaysint
Specifies the size of enumerated types.
Prototype
#pragma enumsalwaysint on | off | reset
Remarks
If you enable this pragma, the C compiler makes an enumerated type the same size as
an int. If an enumerated constant is larger than int, the compiler generates an error.
Otherwise, the compiler makes an enumerated type the size of any integral type. It
chooses the integral type with the size that most closely matches the size of the largest
enumerated constant. The type could be as small as a char or as large as a long
int.
Listing C.7
shows an example.