Errors while using far pointer in c Using gcc on linux
Posted: Wed Jun 07, 2017 8:09 am
I had to use far pointers in Kernel , when i using the far pointer to test i coded to test the following code before using in my kernel . Getting errors.
#include <stdio.h>
int main(){
int a=50;
int far* b;
b=&a;
printf("%Fp",b);
return 0;
}
test.c: In function ‘main’:
test.c:5:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
int far* b;
^
test.c:5:15: error: ‘b’ undeclared (first use in this function)
int far* b;
^
test.c:5:15: note: each undeclared identifier is reported only once for each function it appears in
#include <stdio.h>
int main(){
int a=50;
int far* b;
b=&a;
printf("%Fp",b);
return 0;
}
test.c: In function ‘main’:
test.c:5:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
int far* b;
^
test.c:5:15: error: ‘b’ undeclared (first use in this function)
int far* b;
^
test.c:5:15: note: each undeclared identifier is reported only once for each function it appears in