home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.compilers / comp.sys.amiga.programmer_20895_000000.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  1.6 KB

  1. Path: etek.chalmers.se!chalmers.se!sunic!mcsun!uunet!wupost!darwin.sura.net!cs.ucf.edu!kruse
  2. From: kruse@cs.ucf.edu (Holger Kruse )
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: SAS C 6.0 weirdness with __inline
  5. Message-ID: <kruse.719496887@eola.cs.ucf.edu>
  6. Date: 19 Oct 92 12:14:47 GMT
  7. References: <0s6zr9@rpi.edu>
  8. Sender: news@cs.ucf.edu (News system)
  9. Organization: University of Central Florida
  10. Lines: 38
  11.  
  12. pooler@aix02.ecs.rpi.edu (Robert Peter Poole) writes:
  13.  
  14.  
  15. >I've been trying to write code to take advantage of the __inline feature of
  16. >SAS C 6.0.  For example
  17.  
  18. >int __inline foo(int uplim)
  19. >{
  20. >    return((rand48() >> 3) % uplim);
  21. >}
  22.  
  23. >Or something similar.  Now, it compiles fine, but when I go to use the linker,
  24. >slink gives an error!  Can't find the symbol, etc.
  25.  
  26. >What gives?  Is there some special linker option I should set to use inline
  27. >function declarations?
  28.  
  29. >I'd be asking EMITS this question, except that I rather intelligently left
  30. >my old registration number back home (and I'm here at grad school with no
  31. >way to check it).
  32.  
  33. >Ah, well, perhaps someone has had the same problem?
  34.  
  35. Yes, I had the same problem. When you use the global Optimizer and call
  36. the __inline-function ONLY from the module where it has been defined,
  37. everything works fine. But if you compile without global optimizer or
  38. call the function from a different module, the linker will complain about
  39. an undefined symbol.
  40. At least this was my experience.
  41.  
  42. I reported that bug via EMITS about a week ago.
  43.  
  44. >Rob Poole
  45. >pooler@rpi.edu
  46. >pooler@cs.rpi.edu
  47.  
  48. Holger Kruse
  49. kruse@eola.cs.ucf.edu
  50.