https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20422

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since r0-89441 (aka PR 30949), we print out:

<source>:21: warning: passing argument 1 of 'mymalloc' from incompatible
pointer type
<source>:8: note: expected 'void **' but argument is of type 'char **'
<source>:25: warning: passing argument 1 of 'mymalloc' from incompatible
pointer type
<source>:8: note: expected 'void **' but argument is of type 'char *'

And on the trunk we give:
<source>: In function 'main':
<source>:21:23: warning: passing argument 1 of 'mymalloc' from incompatible
pointer type [-Wincompatible-pointer-types]
   21 |         if (!mymalloc(&pString, 255)) { free(pString); }
      |                       ^~~~~~~~
      |                       |
      |                       char **
<source>:8:25: note: expected 'void **' but argument is of type 'char **'
    8 |     int mymalloc(void **pPointer, size_t size)
      |                  ~~~~~~~^~~~~~~~
<source>:25:23: warning: passing argument 1 of 'mymalloc' from incompatible
pointer type [-Wincompatible-pointer-types]
   25 |         if (!mymalloc(pString, 255)) { free(pString); }
      |                       ^~~~~~~
      |                       |
      |                       char *
<source>:8:25: note: expected 'void **' but argument is of type 'char *'
    8 |     int mymalloc(void **pPointer, size_t size)
      |                  ~~~~~~~^~~~~~~~


Which shows exactly what you need.

_mymalloc has an explicit cast so there is no warning and warning there would
not be helpful.

So just marking this as a dup of bug 30949.

*** This bug has been marked as a duplicate of bug 30949 ***

Reply via email to