28-07-2010, 10:46 AM
Hello,
rule 11.1 disallows conversions between function pointers and any other type than integral type.
1. conversion between compatible function types - are they allowed? For example:
2. what about following case?
rule 11.1 disallows conversions between function pointers and any other type than integral type.
1. conversion between compatible function types - are they allowed? For example:
Code:
typedef struct S1 { int x; } TS1;
struct S1 (*f1)();
TS1 (*f2)();
f1 = f2; // Is this compliant?
2. what about following case?
Code:
enum STYPE_LIST {
TYPEA,
};
typedef int (*func_t)(char *);
typedef STYPE_LIST (*func_t2)(char *);
void moo() {
func_t p;
func_t2 p2;
p= (func_t)p2; // Is this compliant? Enum vs int
}