FAR * in 64-bit machines

Discussion in 'C Programming' started by pendell, Jan 23, 2004.

  1. pendell

    pendell Guest

    I am attempting to port a 32-bit application to a 64-bit Itanium
    processor architecture.

    One of the problems I am having is FAR * declarations are being
    rejected by the compiler as "incompatible size". I am assuming that
    FAR * is a 32-bit or so call that is inadequate on a 64-bit machine.

    What do I need to declare a FAR pointer on a 64-bit machine to be?
    FAR FAR? long FAR? REAL REAL FAR? Somebody throw me a bone here.

    Many thanks.

    Respectfully,

    Brian P.
    pendell, Jan 23, 2004
    #1
    1. Advertising

  2. pendell

    Ben Pfaff Guest

    (pendell) writes:

    > I am attempting to port a 32-bit application to a 64-bit Itanium
    > processor architecture.
    >
    > One of the problems I am having is FAR * declarations are being
    > rejected by the compiler as "incompatible size". I am assuming that
    > FAR * is a 32-bit or so call that is inadequate on a 64-bit machine.
    >
    > What do I need to declare a FAR pointer on a 64-bit machine to be?
    > FAR FAR? long FAR? REAL REAL FAR? Somebody throw me a bone here.


    FAR is not part of the standard C language. It is some kind of
    extension provided by your compiler vendor. You will have to
    consult a newsgroup that discusses your vendor's compiler.
    --
    int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.\
    \n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
    );while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p\
    );}return 0;}
    Ben Pfaff, Jan 23, 2004
    #2
    1. Advertising

  3. pendell

    xarax Guest

    "Ben Pfaff" <> wrote in message
    news:...
    > (pendell) writes:
    >
    > > I am attempting to port a 32-bit application to a 64-bit Itanium
    > > processor architecture.
    > >
    > > One of the problems I am having is FAR * declarations are being
    > > rejected by the compiler as "incompatible size". I am assuming that
    > > FAR * is a 32-bit or so call that is inadequate on a 64-bit machine.
    > >
    > > What do I need to declare a FAR pointer on a 64-bit machine to be?
    > > FAR FAR? long FAR? REAL REAL FAR? Somebody throw me a bone here.

    >
    > FAR is not part of the standard C language. It is some kind of
    > extension provided by your compiler vendor. You will have to
    > consult a newsgroup that discusses your vendor's compiler.


    Isn't LP64 a standard specification for 64-bit
    pointers and integers? If so, then we can talk
    about how a conforming implementation would
    deal with 64-bit pointers.
    xarax, Jan 24, 2004
    #3
  4. On Sat, 24 Jan 2004 14:40:33 +0000, xarax wrote:

    > "Ben Pfaff" <> wrote in message
    > news:...
    >> (pendell) writes:
    >>
    >> > What do I need to declare a FAR pointer on a 64-bit machine to be?

    >>
    >> FAR is not part of the standard C language.

    >
    > Isn't LP64 a standard specification for 64-bit
    > pointers and integers? If so, then we can talk
    > about how a conforming implementation would
    > deal with 64-bit pointers.


    From what I could glean from Google
    (http://www.opengroup.org/public/tech/aspen/lp64_wp.htm), LP64 is not a
    standard but merely a description of a certain way of implementing a
    64-bit system (specifically, long and pointers being 64 bits wide while
    int is smaller). As such, it would be on-topic to discuss the consequences
    of compiling code for an LP64 system (eg, "That call to memmove would
    result in UB if long were 64 bits wide"). However, the OP's question was
    not about an LP64 system. It seems to me that the OP was asking about a
    system where there are various sizes for pointers (akin to the old DOS
    apps), and specifically he was asking about an extension to a particular
    compiler which allows one to utilize said feature.

    Josh
    Josh Sebastian, Jan 24, 2004
    #4
  5. On Sat, 24 Jan 2004 14:40:33 GMT, "xarax" <> wrote:

    snip

    >Isn't LP64 a standard specification for 64-bit
    >pointers and integers? If so, then we can talk
    >about how a conforming implementation would
    >deal with 64-bit pointers.
    >


    No, it is not.

    The string LP64 does not appear anywhere in n869, the last public
    draft of the standard, and it is unlikely it was added at the last
    minute.


    <<Remove the del for email>>
    Barry Schwarz, Jan 25, 2004
    #5
  6. pendell

    Dan Pop Guest

    In <BtvQb.24727$> "xarax" <> writes:

    >"Ben Pfaff" <> wrote in message
    >news:...
    >> (pendell) writes:
    >>
    >> > I am attempting to port a 32-bit application to a 64-bit Itanium
    >> > processor architecture.
    >> >
    >> > One of the problems I am having is FAR * declarations are being
    >> > rejected by the compiler as "incompatible size". I am assuming that
    >> > FAR * is a 32-bit or so call that is inadequate on a 64-bit machine.
    >> >
    >> > What do I need to declare a FAR pointer on a 64-bit machine to be?
    >> > FAR FAR? long FAR? REAL REAL FAR? Somebody throw me a bone here.

    >>
    >> FAR is not part of the standard C language. It is some kind of
    >> extension provided by your compiler vendor. You will have to
    >> consult a newsgroup that discusses your vendor's compiler.

    >
    >Isn't LP64 a standard specification for 64-bit
    >pointers and integers? If so, then we can talk
    >about how a conforming implementation would
    >deal with 64-bit pointers.


    Nope, LP64 is not a requirement for a conforming implementation any more
    than ILP32 is. A 64-bit implementation could very well use the IL32P64
    model without having its conformance affected. That's precisely why
    C99 has introduced the long long type which is required to have at least
    64 bits.

    Given Microsoft's past track record, I would be very surprised if the
    type long is 64 bits on its Itanium implementation.

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
    Dan Pop, Jan 27, 2004
    #6
  7. pendell

    pendell Guest

    (Dan Pop) wrote in message news:<bv68sj$h65$>...
    > In <BtvQb.24727$> "xarax" <> writes:
    >
    > >"Ben Pfaff" <> wrote in message
    > >news:...
    > >> (pendell) writes:
    > >>
    > >> > I am attempting to port a 32-bit application to a 64-bit Itanium
    > >> > processor architecture.
    > >> >
    > >> > One of the problems I am having is FAR * declarations are being
    > >> > rejected by the compiler as "incompatible size". I am assuming that
    > >> > FAR * is a 32-bit or so call that is inadequate on a 64-bit machine.
    > >> >
    > >> > What do I need to declare a FAR pointer on a 64-bit machine to be?
    > >> > FAR FAR? long FAR? REAL REAL FAR? Somebody throw me a bone here.
    > >>
    > >> FAR is not part of the standard C language. It is some kind of
    > >> extension provided by your compiler vendor. You will have to
    > >> consult a newsgroup that discusses your vendor's compiler.

    > >
    > >Isn't LP64 a standard specification for 64-bit
    > >pointers and integers? If so, then we can talk
    > >about how a conforming implementation would
    > >deal with 64-bit pointers.


    Right ... so I need to consult my vendor (HP, in this case). So it's
    not a standard part of the C language. Nuts... for some reason I
    thought it was.

    Thanks anyway.

    Respectfully,

    Brian P.
    pendell, Feb 2, 2004
    #7
  8. >> >> > I am attempting to port a 32-bit application to a 64-bit Itanium
    >> >> > processor architecture.
    >> >> >
    >> >> > One of the problems I am having is FAR * declarations are being
    >> >> > rejected by the compiler as "incompatible size". I am assuming that
    >> >> > FAR * is a 32-bit or so call that is inadequate on a 64-bit machine.
    >> >> >
    >> >> > What do I need to declare a FAR pointer on a 64-bit machine to be?
    >> >> > FAR FAR? long FAR? REAL REAL FAR? Somebody throw me a bone here.
    >> >>
    >> >> FAR is not part of the standard C language. It is some kind of
    >> >> extension provided by your compiler vendor. You will have to
    >> >> consult a newsgroup that discusses your vendor's compiler.

    >
    >Right ... so I need to consult my vendor (HP, in this case).


    far (and "near") was (is) something used in the 16-bit DOS environment,
    to do some fancy segment operations.

    However, this came pretty obsolete when 32-bit was introduced, and
    is only there to provide compatibility. gcc doesnot even recognize these
    keywords.
    Jan Engelhardt, Feb 4, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy Dingley
    Replies:
    45
    Views:
    1,631
    Andy Mabbett
    Jun 11, 2006
  2. Why Tea

    Arithmetic for 32-bit and 64-bit machines

    Why Tea, Jan 9, 2008, in forum: C Programming
    Replies:
    10
    Views:
    649
    cr88192
    Jan 10, 2008
  3. Rob Clewley
    Replies:
    4
    Views:
    2,652
    Martin v. Löwis
    Mar 22, 2009
  4. Cristina
    Replies:
    2
    Views:
    120
    Nate St.Germain
    Jul 16, 2010
  5. Sal
    Replies:
    16
    Views:
    186
    Ilya Zakharevich
    May 25, 2010
Loading...

Share This Page