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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
-Wpedantic catches it:

$ /usr/local/bin/gcc -c -O2 -S -Wall -Wextra -pedantic
-fdump-tree-optimized=/dev/stdout 95485.c
95485.c: In function 'f':
95485.c:6:20: warning: ISO C forbids passing argument 1 of '__builtin_memset'
between function pointer and 'void *' [-Wpedantic]
    6 |  __builtin_memset (p, 0, 32);   // zero out -- whoops! -- writing to a
function
      |                    ^
95485.c:6:20: note: expected 'void *' but argument is of type 'void * (*)(int)'

;; Function f (f, funcdef_no=0, decl_uid=1910, cgraph_uid=1, symbol_order=0)

f (void * (*<T318>) (int) p)
{
  void * q;

  <bb 2> [local count: 1073741824]:
  q_4 = p_2(D) (32);
  __builtin_memset (p_2(D), 0, 32);
  return q_4;

}


$

Reply via email to