home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2263 < prev    next >
Encoding:
Text File  |  1992-09-07  |  3.7 KB  |  97 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!skipsun.UUCP!skip
  3. From: skip@skipsun.UUCP (Skip Gilbrech)
  4. Subject: Re: Using g++2.1 with standard C library on SunOS 4.1.1 Rev B.
  5. Message-ID: <9209050116.AA04670@skipsun.UUCP>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. References: <9209010519.AA13772@mole.gnu.ai.mit.edu>
  9. Distribution: gnu
  10. Date: Sat, 5 Sep 1992 01:16:17 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 83
  13.  
  14. You write:
  15.  
  16. >    What I would really like to do, is turn off builtin functions, and the
  17. >    builtin function prototypes.
  18. >
  19. >This is the wrong approach, for a basic philosophical reason.
  20. >
  21. >You have found a feature which, in a particular case, fails to work.
  22. >To think that the solution is to turn off the feature is to assume
  23. >that it can *never* work.
  24. >
  25. >But it is absurd to assume that.  We don't know why it does not work.
  26. >It may be failing for a trivial reason.  It is silly to give up on the
  27. >feature without first checking the possibility that it can easily be
  28. >fixed.
  29. >
  30. >I can't tell you what to do.  Those of you who wish to give up on a
  31. >feature can do so.  But for those of you who are interested in what I
  32. >have to say, I urge you to take a constructive approach and help get
  33. >things fixed.
  34. >
  35. >See the Bugs chapter of the GCC manual for a general guide to how to do this.
  36. >
  37. >In the case of a type conflict with a built-in function, the main
  38. >useful thing for you to do is to find the declaration that conflicts
  39. >and tell us precisely what data types the conflicting declaration
  40. >uses.  Most importantly, find out what size_t is in the system headers.
  41.  
  42.  
  43. Yes, but not everyone has the time, inclination, or expertise to find
  44. and fix such conflicts, and even when they do, their only practical
  45. option may be to make local copies of screwed-up system headers, most
  46. often for extremely trivial conflicts that will have absolutely no
  47. effect on the generated code.
  48.  
  49. And anyway, do you really want each of the thousands of people who
  50. will encounter conflicts on Sun's, for instance, to send in a report
  51. telling you (again..) how size_t is (mis-)declared?  This might be
  52. reasonable on obscure systems, but the point is that the inconvenience
  53. caused by these conflicts persists for many people _long_ after the
  54. cause is well known.
  55.  
  56. To me, it seems largely an issue of dictating choices versus allowing
  57. the user to decide what tradeoffs are important to her/him: the
  58. advantages offered by built-ins may or may not be significant in a
  59. given situation, but as it is now, there's no easy way to avoid
  60. dealing with their downside regardless...
  61.  
  62. For these and other reasons, I would really appreciate (as would I'm
  63. quite sure many others) a command-line _option_ to totally disable
  64. built-in functions (and their prototypes).
  65.  
  66. Whatever is decided on that issue, though, gcc conflict warnings would
  67. be much more useful if they gave a hint as to what conflicts with
  68. what.  Given a bogus declaration like:
  69.  
  70.         double memcpy(int, char *);
  71.  
  72. for instance, gcc, when wearing its `c' hat, says:
  73.  
  74. Goo.c:5: warning: conflicting types for built-in function `memcpy'
  75.  
  76. but doesn't say what it's looking for!  How is one supposed to resolve
  77. that conflict without searching through the gcc source and
  78. configuration files, etc.?
  79.  
  80. g++ at least puts out some useful information before choking:
  81.  
  82. Goo.cc:5: declaration of `double  memcpy (int, char *)'
  83. <built-in>:0: conflicts with built-in declaration `void * memcpy (void *, const void *, unsigned int)'
  84.  
  85. Any reason gcc in `c' mode can't be as forthcoming?
  86.  
  87.  
  88. -Skip
  89.  
  90. -- 
  91. Skip Gilbrech            email:    skip@fsg.com
  92. Fusion Systems Group            uupsi!fsg!skip
  93. 225 Broadway, 24th Floor        uupsi!skipnyc!skip
  94. New York, NY 10007        phones:    212-285-8001 (work)
  95.                     201-825-8732 (home)
  96.  
  97.