home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17930 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  1.6 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!gatech!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!mcdchg!mcdphx!udc!qbarnes
  2. From: qbarnes@urbana.mcd.mot.com (Quentin Barnes)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: AmigaDOS library functions and ANSI-C programming
  5. Message-ID: <1992Dec29.221144.26405@urbana.mcd.mot.com>
  6. Date: 29 Dec 92 22:11:44 GMT
  7. Sender: news@urbana.mcd.mot.com (News)
  8. Organization: Motorola Computer Group, Urbana Design Center
  9. Lines: 29
  10. Nntp-Posting-Host: neptune.urbana.mcd.mot.com
  11.  
  12. I am learning to write AmigaDOS-specific programs on my Amiga using
  13. SAS/C 6.1.
  14.  
  15. I ran across a widespread problem with the AmigaDOS specific
  16. prototypes/libraries with writing ANSI-C code.  AmigaDOS
  17. functions which take pointers to objects when the objects
  18. aren't modified are not marked as "const".  For example,
  19. the ANSI-C code:
  20.         const char *s = "mylib";
  21.         OpenLibrary(s,0L);
  22.  
  23. will generate a warning from SAS/C since the prototype in the
  24. header file (as well as in the RKMs) says that the first argument
  25. to the OpenLibrary() call is not qualifed as "const".  [I didn't
  26. actually compile the example; it's for illustrative purposes only.]
  27.  
  28. I don't care about hacks such as marking those errors ignored
  29. or casting.  The real problem is that the AmigaDOS library
  30. function calls need their signatures cleaned up.  This may be
  31. an annoying problem with ANSI-C code, but it will prove fatal
  32. with C++.
  33.  
  34. Has the problem been covered before?  Is there plans in the
  35. works to support ANSI-C/C++ clean AmigaDOS library calls?
  36.  
  37.  
  38. -- 
  39. Quentin Barnes
  40. qbarnes@urbana.mcd.mot.com | ..!uiucuxc!udc!qbarnes
  41.