This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/4676: Warning when casting to a __stdcall function pointer
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/4676: Warning when casting to a __stdcall function pointer
- From: benjamin dot riefenstahl at epost dot de
- Date: 24 Oct 2001 17:59:33 -0000
- Reply-To: benjamin dot riefenstahl at epost dot de
>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: