home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!uvaarpa!concert!sas!mozart.unx.sas.com!walker
- From: walker@twix.unx.sas.com (Doug Walker)
- Subject: Re: help with error: NEAR/FAR reference
- Originator: walker@twix.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BxtAtJ.KC6@unx.sas.com>
- Date: Mon, 16 Nov 1992 13:58:30 GMT
- References: <1992Nov14.232146.2366@sol.UVic.CA>
- Nntp-Posting-Host: twix.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 47
-
-
- In article <1992Nov14.232146.2366@sol.UVic.CA>, aramsey@ugly.UVic.CA (Aaron Ramsey) writes:
- |> I've got a program that gives me a warning.. and I can't figure it out..
- |>
- |> <programname> 209 Warning 169: too much global data for NEAR reference, change
- |> some to FAR
- |>
- |> How do I change it to FAR reference? I'm using SAS 5.10. I tried moving my
-
- Put the __far keyword on one or more of your larger data items,
- or compile with the -b0 option to make all data references far.
- If you use -b0, make sure to link with the 'nb' versions of the
- libraries - the LC command will do this automatically for you,
- but if you use BLINK directly, you will have to modify your
- library list.
-
- |> subroutines around to try and compensate for any jumps being made by calls to
- |> subroutines, but it made no difference. This error shows up at the very
- |> last line of my program (which happens to be blank). How can I get rid of this?
- |> And what is causing it exactly? My main() is about 160 line or so, with
- |> quite a few if statements... nothing that I would have thought would take
- |> up tons of memory when put into assemly... I dunno.
-
- It isn't your CODE that's too big, it's your DATA - read the message.
- You have more data than can be accessed via a 16-bit offset, so you
- have to tell the compiler to generate 32-bit offsets to at least
- some of it. The __far keyword tells it to generate 32-bit offsets
- to the marked items; -b0 tells it to generate 32-bit offsets to
- everything.
-
- Another thing to consider would be to allocate space for that large
- array dynamically instead of declaring it as an extern. Use the
- malloc() function and the memory will automatically be freed when
- you exit. (I assume you have a large array since I doubt that you
- have declared 64k worth of non-array "int" variables 8^)
-
- |> -Aaron Ramsey........... bewildered beginning C programmer. 8-)
-
- --
- *****
- =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
- *|. o.| || 1200/2400/9600 Dual
- | o |// For all you do, this bug's for you!
- ======
- usenet: walker@unx.sas.com bix: djwalker
- Any opinions expressed are mine, not those of SAS Institute, Inc.
-
-