This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/6626: __attribute__ doen not works with function pointers



>Number:         6626
>Category:       c++
>Synopsis:       __attribute__ doen not works with function pointers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri May 10 11:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Grigoriev
>Release:        gcc version 3.1 20020423 (prerelease)
>Organization:
>Environment:
Cygwin
>Description:
__attribute__((__stdcall__)) void test(int *x)
{
  *x = 1;
}

int main(void)
{
  __attribute__((__stdcall__)) void (*local)(int *x);


//this line produces NO error in C++ and C
  local = (void (*)(int*)) test;


//this line produces error in C++ (and works in C)
//error message: invalid conversion from `void (*)(int*)' to `void (*)(int*)'
  local = test;

}
>How-To-Repeat:
see source in description
>Fix:
unknown
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]