Skip to content

Commit

Permalink
Allow incorrect typedef with va_list
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard-ryan-immersaview committed May 27, 2024
1 parent d6af328 commit cd1d3c7
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 27 deletions.
10 changes: 7 additions & 3 deletions tests/expectations/va_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@

typedef int32_t (*VaListFnPtr)(va_list);

typedef int32_t (*VaListFnPtr2)(va_list);
typedef int32_t (*VaListFnPtr2)(void);

typedef struct {
int32_t (*fn1)(va_list);
} Interface_______i32_______va_list;

typedef struct {
int32_t (*fn1)(void);
} Interface_______i32;

int32_t va_list_test(va_list ap);

int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(void),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
Interface_______i32_______va_list fn5,
Interface_______i32_______va_list fn6);
Interface_______i32 fn6);
10 changes: 7 additions & 3 deletions tests/expectations/va_list.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@

typedef int32_t (*VaListFnPtr)(va_list);

typedef int32_t (*VaListFnPtr2)(va_list);
typedef int32_t (*VaListFnPtr2)(void);

typedef struct {
int32_t (*fn1)(va_list);
} Interface_______i32_______va_list;

typedef struct {
int32_t (*fn1)(void);
} Interface_______i32;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
Expand All @@ -20,11 +24,11 @@ int32_t va_list_test(va_list ap);
int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(void),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
Interface_______i32_______va_list fn5,
Interface_______i32_______va_list fn6);
Interface_______i32 fn6);

#ifdef __cplusplus
} // extern "C"
Expand Down
6 changes: 3 additions & 3 deletions tests/expectations/va_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

using VaListFnPtr = int32_t(*)(va_list);

using VaListFnPtr2 = int32_t(*)(va_list);
using VaListFnPtr2 = int32_t(*)();

template<typename T>
struct Interface {
Expand All @@ -20,10 +20,10 @@ int32_t va_list_test(va_list ap);
int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
Interface<int32_t(*)(va_list)> fn5,
Interface<int32_t(*)(va_list)> fn6);
Interface<int32_t(*)()> fn6);

} // extern "C"
9 changes: 6 additions & 3 deletions tests/expectations/va_list.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ cdef extern from *:

ctypedef int32_t (*VaListFnPtr)(va_list);

ctypedef int32_t (*VaListFnPtr2)(va_list);
ctypedef int32_t (*VaListFnPtr2)();

ctypedef struct Interface_______i32_______va_list:
int32_t (*fn1)(va_list);

ctypedef struct Interface_______i32:
int32_t (*fn1)();

int32_t va_list_test(va_list ap);

int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
Interface_______i32_______va_list fn5,
Interface_______i32_______va_list fn6);
Interface_______i32 fn6);
10 changes: 7 additions & 3 deletions tests/expectations/va_list_both.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@

typedef int32_t (*VaListFnPtr)(va_list);

typedef int32_t (*VaListFnPtr2)(va_list);
typedef int32_t (*VaListFnPtr2)(void);

typedef struct Interface_______i32_______va_list {
int32_t (*fn1)(va_list);
} Interface_______i32_______va_list;

typedef struct Interface_______i32 {
int32_t (*fn1)(void);
} Interface_______i32;

int32_t va_list_test(va_list ap);

int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(void),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
struct Interface_______i32_______va_list fn5,
struct Interface_______i32_______va_list fn6);
struct Interface_______i32 fn6);
10 changes: 7 additions & 3 deletions tests/expectations/va_list_both.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@

typedef int32_t (*VaListFnPtr)(va_list);

typedef int32_t (*VaListFnPtr2)(va_list);
typedef int32_t (*VaListFnPtr2)(void);

typedef struct Interface_______i32_______va_list {
int32_t (*fn1)(va_list);
} Interface_______i32_______va_list;

typedef struct Interface_______i32 {
int32_t (*fn1)(void);
} Interface_______i32;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
Expand All @@ -20,11 +24,11 @@ int32_t va_list_test(va_list ap);
int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(void),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
struct Interface_______i32_______va_list fn5,
struct Interface_______i32_______va_list fn6);
struct Interface_______i32 fn6);

#ifdef __cplusplus
} // extern "C"
Expand Down
10 changes: 7 additions & 3 deletions tests/expectations/va_list_tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@

typedef int32_t (*VaListFnPtr)(va_list);

typedef int32_t (*VaListFnPtr2)(va_list);
typedef int32_t (*VaListFnPtr2)(void);

struct Interface_______i32_______va_list {
int32_t (*fn1)(va_list);
};

struct Interface_______i32 {
int32_t (*fn1)(void);
};

int32_t va_list_test(va_list ap);

int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(void),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
struct Interface_______i32_______va_list fn5,
struct Interface_______i32_______va_list fn6);
struct Interface_______i32 fn6);
10 changes: 7 additions & 3 deletions tests/expectations/va_list_tag.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@

typedef int32_t (*VaListFnPtr)(va_list);

typedef int32_t (*VaListFnPtr2)(va_list);
typedef int32_t (*VaListFnPtr2)(void);

struct Interface_______i32_______va_list {
int32_t (*fn1)(va_list);
};

struct Interface_______i32 {
int32_t (*fn1)(void);
};

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
Expand All @@ -20,11 +24,11 @@ int32_t va_list_test(va_list ap);
int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(void),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
struct Interface_______i32_______va_list fn5,
struct Interface_______i32_______va_list fn6);
struct Interface_______i32 fn6);

#ifdef __cplusplus
} // extern "C"
Expand Down
9 changes: 6 additions & 3 deletions tests/expectations/va_list_tag.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ cdef extern from *:

ctypedef int32_t (*VaListFnPtr)(va_list);

ctypedef int32_t (*VaListFnPtr2)(va_list);
ctypedef int32_t (*VaListFnPtr2)();

cdef struct Interface_______i32_______va_list:
int32_t (*fn1)(va_list);

cdef struct Interface_______i32:
int32_t (*fn1)();

int32_t va_list_test(va_list ap);

int32_t va_list_test2(va_list ap);

void va_list_fn_ptrs(int32_t (*fn1)(va_list),
int32_t (*fn2)(va_list),
int32_t (*fn2)(),
VaListFnPtr fn3,
VaListFnPtr2 fn4,
Interface_______i32_______va_list fn5,
Interface_______i32_______va_list fn6);
Interface_______i32 fn6);

0 comments on commit cd1d3c7

Please sign in to comment.