The FARWARNING directive enables extra warnings when an
address calculation with far variables only affects the offset part
(lower 16-bit of an address. This directive has been implemented to
allow checking of code that should address the complete 24-bit
address space.
Example
#pragma O2 VARBANKING
char far *cp;
int far *ip;
int i;
int far fa2[10][10];
char far ca2[10][10];
#pragma FARWARNING
void test1 (void) {
cp = &ca2[i][0];
cp = &ca2[(long)i][10L];
i = fa2 [i][0];
i = fa2 [(long)i][2];
i = fa2 [(long)i][1L];
cp++; // warning C287 issued
--cp; // warning C287 issued
cp += 1; // warning C287 issued
cp += 1L; // no warning, full 24-bit address calculation
cp -= 1; // warning C287 issued
cp -= 1L; // no warning, full 24-bit address calculation
ip += 2; // warning C287 issued
ip -= 2; // warning C287 issued
ip += 2L; // no warning, full 24-bit address calculation
ip -= 2L; // no warning, full 24-bit address calculation
ip[(unsigned long)*cp] = 0; // no warning, full 24-bit address calculation
ip[*cp] = 0; // warning C287 issued
i = ip[5]; // warning C287 issued
i = ip[5L]; // no warning, full 24-bit address calculation
}
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.