home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / gcc / bug / 3065 < prev    next >
Encoding:
Text File  |  1992-12-27  |  2.3 KB  |  62 lines

  1. Path: sparky!uunet!crdgw1!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!zuma.AUdacter.NL!ruud
  2. From: ruud@zuma.AUdacter.NL (Ruud Cox)
  3. Newsgroups: gnu.gcc.bug
  4. Subject: Problems with pointer to pointer to void (type[Pparameter passing)
  5. Message-ID: <9212241609.AA36.V1.4@zuma.audacter.nl>
  6. Date: 24 Dec 92 21:09:03 GMT
  7. Sender: gnulists@ai.mit.edu
  8. Distribution: gnu
  9. Organization: GNUs Not Usenet
  10. Lines: 49
  11. Approved: bug-gcc@prep.ai.mit.edu
  12.  
  13. Hai,
  14.  
  15. When we were porting our C libraries to GNU C, we encountered the following
  16. problem:
  17.  
  18. GCC VERSION:      GNU C 3.2.1
  19. MACHINETYPE:      Sun Sparc station IPX (sun4c)
  20. OS VERSION:       sunos 4.1.3
  21. CONFIGURATION:    sparc-sun-sunos4.3.1
  22. CHANGES TO GCC:   none
  23.  
  24. COMMANDLINE ARGUMENTS: gcc -c tgcc.c
  25.  
  26. When compiling undermentioned program GNU C produces the following Warning:
  27.  
  28. tgcc: In function 'main':
  29. tgcc[A.c: In function 'main':[B[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D.c:10: warning: passing arg 1 of 'test_voidpp' from incompatible pointer type
  30.  
  31. To my knowledge this is wrong. A cast from pointer to pointer to int is
  32. compatible with a pointer to a pointer to a void.
  33.  
  34. We could change void ** to void *, but then we can pass 'intp' without '&' to
  35. the funtion without the compiler giving sn error.
  36. ----------------------------------------------------------------------------
  37. [A[C[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ca[B[B[H[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[Btest_voidpp(void **pp)
  38. {
  39. }
  40.  
  41. main()
  42. {
  43.     int *intp;
  44.  
  45.     test_voidpp(&intp);
  46. }
  47. -----------------------------------------------------------------[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D
  48. [A                       [B[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[Dtest_voidpp(void **pp)[B[H[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B{
  49. }
  50.       [B[D[D[D[D[D[Dmain()
  51. {
  52. [A[C[C[C[C          [B[D[D[D[D[D[D[D[D[D[Dint *intp;
  53.                        [B[H[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B[B    test_voidpp(&intp);
  54.                                                                   [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[A[C}
  55. ----------------------------------------------------------------------------
  56.  
  57. Ruud Cox
  58. st. Leonardusstraat 10B[D B
  59. 5614 EH Eindhoven
  60. Netherlands
  61. e-mail: ruud@zuma.audacter.nl
  62.