From mboxrd@z Thu Jan 1 00:00:00 1970 From: benjamin.riefenstahl@epost.de To: gcc-gnats@gcc.gnu.org Subject: c/4676: Warning when casting to a __stdcall function pointer Date: Thu, 25 Oct 2001 16:27:00 -0000 Message-id: <20011024175933.28163.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00503.html List-Id: >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: