Opened 4 years ago

Closed 4 years ago

#35 closed defect (fixed)

Function pointer casts are broken

Reported by: Thierry Delisle Owned by: Rob Schluntz <rschlunt@…>
Priority: blocker Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

I need this to work for external scheduling :

extern void save( void (*func)() );

void foo( int a ) {
	save( &foo );
}

Change History (4)

comment:1 Changed 4 years ago by Rob Schluntz

What do we actually want there? This does not work in C++, and since we're aiming for stronger types like C++, I don't think we can make this work without an explicit cast.

comment:2 Changed 4 years ago by Thierry Delisle

This would be fine for me but it also doesn't work :

typedef void (*generic_func_t)();

extern void save( generic_func_t func );

void foo( int a ) {
	save( (generic_func_t)foo );
}

comment:3 Changed 4 years ago by Rob Schluntz

Okay, I think I've fixed this. Just running the tests now.

comment:4 Changed 4 years ago by Rob Schluntz <rschlunt@…>

Owner: set to Rob Schluntz <rschlunt@…>
Resolution: fixed
Status: newclosed

In ae4038d:

Fix tuple specialize check to more precisely determine where tuple specialization is necessary [fixes #35]

Note: See TracTickets for help on using tickets.