c/4676: Warning when casting to a __stdcall function pointer

benjamin.riefenstahl@epost.de benjamin.riefenstahl@epost.de
Thu Oct 25 16:27:00 GMT 2001


>Number:         4676
>Category:       c
>Synopsis:       Warning when casting to a __stdcall function pointer
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 16:26:19 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     benjamin.riefenstahl@epost.de
>Release:        gcc-3.0.1
>Organization:
>Environment:
Cygwin, Windows 2000
>Description:
The attached code gets me a warning on the indicated line. All
other lines compile o.k.  The code compiles o.k. in C++ mode.

(Note: "__stdcall" is a predefined macro for
"__attribute__(stdcall)", so in gcc terms this is a problem
with function attributes.)

> >>>>>>>>>>
int __stdcall func( void );

int (__stdcall * func_ptr)( void ) = func;

// warning: initialization from incompatible pointer type
int (__stdcall * func_ptr2)( void ) = (int (__stdcall *)( void )) 0;

typedef int (__stdcall * func_type)( void );
func_type func_ptr3 = (func_type) 0;
<<<<<<<<<<<

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list