Keil Logo

GENERAL: #DEFINE FOR #PRAGMA


Information in this article applies to:

  • C166 All Versions
  • C251 All Versions
  • C51 All Versions

SYMPTOMS

Why can't I use the #define preprocessor text substitution to make #pragma statements for the compiler?

CAUSE

#pragma and #define are both preprocessor statements and each requires its own separate line.

RESOLUTION

#pragma and #define statements must be on separate lines. The compiler generates an error if the following example is used:

#define asmbegin    #pragma asm
#define asmend      #pragma endasm

asmbegin
asmend

Last Reviewed: Saturday, May 1, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.