This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About far,near pointer in Keil

I try to compile ucOSII in keil C51.
But it tells me a error at

struct os_event {
        UBYTE  OSEventGrp;             /* Group corresponding to tasks waiting for event to occur      */
        UBYTE  OSEventTbl[8];          /* List of tasks waiting for event to occur                     */
        UWORD  OSEventCnt;             /* Count of used when event is a semaphore                      */
    far void  *OSEventPtr;             /* };
Can anyone tell me how to use far and near to define a pointer?

Parents
  • You have an unclosed comment in the posted snippet. I assume that's a typo.

    Try writing it as "void far *OSEventPtr".

    The syntax for memory specifiers in Keil C is a little odd, and doesn't quite match the behavior of, say, the ANSI C "const" qualifer.

    Don't forget FVAR and FARRAY to create those far pointers from integer addresses. There's an extra offset to take into account.

Reply
  • You have an unclosed comment in the posted snippet. I assume that's a typo.

    Try writing it as "void far *OSEventPtr".

    The syntax for memory specifiers in Keil C is a little odd, and doesn't quite match the behavior of, say, the ANSI C "const" qualifer.

    Don't forget FVAR and FARRAY to create those far pointers from integer addresses. There's an extra offset to take into account.

Children
No data