home *** CD-ROM | disk | FTP | other *** search
- Path: etek.chalmers.se!chalmers.se!sunic!mcsun!uunet!wupost!darwin.sura.net!cs.ucf.edu!kruse
- From: kruse@cs.ucf.edu (Holger Kruse )
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: SAS C 6.0 weirdness with __inline
- Message-ID: <kruse.719496887@eola.cs.ucf.edu>
- Date: 19 Oct 92 12:14:47 GMT
- References: <0s6zr9@rpi.edu>
- Sender: news@cs.ucf.edu (News system)
- Organization: University of Central Florida
- Lines: 38
-
- pooler@aix02.ecs.rpi.edu (Robert Peter Poole) writes:
-
-
- >I've been trying to write code to take advantage of the __inline feature of
- >SAS C 6.0. For example
-
- >int __inline foo(int uplim)
- >{
- > return((rand48() >> 3) % uplim);
- >}
-
- >Or something similar. Now, it compiles fine, but when I go to use the linker,
- >slink gives an error! Can't find the symbol, etc.
-
- >What gives? Is there some special linker option I should set to use inline
- >function declarations?
-
- >I'd be asking EMITS this question, except that I rather intelligently left
- >my old registration number back home (and I'm here at grad school with no
- >way to check it).
-
- >Ah, well, perhaps someone has had the same problem?
-
- Yes, I had the same problem. When you use the global Optimizer and call
- the __inline-function ONLY from the module where it has been defined,
- everything works fine. But if you compile without global optimizer or
- call the function from a different module, the linker will complain about
- an undefined symbol.
- At least this was my experience.
-
- I reported that bug via EMITS about a week ago.
-
- >Rob Poole
- >pooler@rpi.edu
- >pooler@cs.rpi.edu
-
- Holger Kruse
- kruse@eola.cs.ucf.edu
-