home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / std / c / 3412 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  2.0 KB

  1. Path: sparky!uunet!think.com!rpi!crdgw1!rdsunx.crd.ge.com!bart!volpe
  2. From: volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Libraries specified in source?
  5. Message-ID: <1993Jan25.152432.7022@crd.ge.com>
  6. Date: 25 Jan 93 15:24:32 GMT
  7. References: <1993Jan21.182949.29796@cronkite.ocis.temple.edu> <1993Jan23.194202.20332@druid.uucp>
  8. Sender: volpe@bart (Christopher R Volpe)
  9. Reply-To: volpe@ausable.crd.ge.com
  10. Organization: GE Corporate Research & Development
  11. Lines: 45
  12. Nntp-Posting-Host: bart.crd.ge.com
  13.  
  14. In article <1993Jan23.194202.20332@druid.uucp>, darcy@druid.uucp (D'Arcy J.M. Cain) writes:
  15. |> ray@astro.ocis.temple.edu (Ray Lauff) writes:
  16. |> >line of the compiler call.  Of course, using make files can
  17. |> >simplify the process, but why not just have a line in the 
  18. |> >main program such as
  19. |> >
  20. |> >#library "/lib/libc.a"
  21.  
  22. I like the idea, though I wouldn't include path names for standard stuff.
  23. Rather, I would mimic the semantics for #include directives.
  24.  
  25. For example, we don't say 
  26.   #include "/usr/include/math.h"
  27. but rather
  28.   #include <math.h>
  29.  
  30. Similarly, I would prefer to see something like:
  31.   #include <libm.a>
  32.  
  33. to get the math library.
  34.  
  35. |> 
  36. |> Two problems I can think of right off.  How do you know that the
  37. |> function you want is in that library on every system and how do
  38.    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  39.  
  40. That's kind of like asking, in reference to <math.h>, "How do you know
  41. that the prototype for cos() is in that header file on every system?".
  42. The answer is you ammend the Standard with information about what libraries
  43. things are in. And in doing so for standard libraries, you open the doors
  44. for things like:
  45.   #library "userlib.a"
  46.  
  47. |> you know that the libraries reside in that directory?
  48.                                       ^^^^^^^^^^^^^^^^^
  49. Agreed, which is why I suggested nuking the pathname for would-be
  50. "standard" libraries, the same way as is done for standard header files.
  51.  
  52. -Chris
  53.  
  54. -- 
  55. ==================
  56. Chris Volpe
  57. G.E. Corporate R&D
  58. volpecr@crd.ge.com
  59.