Re: bug in visual studio .net 2003 - breakpoints and memcpy



According to ANSI C and standard C++, there is no standard conversion from a
function pointer to void*, and vice versa. It's just not listed among the
possible conversions. A function pointer can be converted to an integer of
an appropriate size, though, which you may (or may not) be able then convert
to a void* (the size of the necessary integer may be different from the
required void* size).

"Eugene Gershnik" <gershnik@xxxxxxxxxxx> wrote in message
news:%23Sj7ZiiiFHA.1244@xxxxxxxxxxxxxxxxxxxxxxx
> Alexander Grigoriev wrote:
>>
>> BTW, converting a function pointer to void * is illegal in C and C++.
>
> Not illegal, just undefined. Which means that an implementation is free to
> define it if it wants so. Both Win32 and Posix define the conversion.
>
>
> --
> Eugene
> http://www.gershnik.com
>
>


.



Relevant Pages

  • Re: Concept of Statements and Expressions
    ... its expression has a function type. ... Later down this post, where you use the phrase "a class conversion", ... conversion to result in a void expression? ... to the issue of expression statement evaluation. ...
    (comp.lang.c)
  • Re: gcc knows about malloc()
    ... If a correct prototype is visible, this expression (after the implicit ... actual conversion and simply yields the same pointer-to-function ... this value to type void *. ...
    (comp.lang.c)
  • Re: srand(time(NULL))
    ... conversion of void * to whatever_type * is implicit). ... you should cast it to void*. ...
    (comp.lang.c)
  • Re: cast to void *
    ... When else is implicit conversion to 'void *' done, ... Except that conversion between void* and struct tm is a constraint ...
    (comp.lang.c)
  • Re: [PATCH 1/2] irq_flags_t: intro and core annotations
    ... * irq_flags_t allows conversion to struct instead of typedef without flag day. ... -static inline void native_restore_fl ...
    (Linux-Kernel)