Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion offload/test/offloading/shared_lib_fp_mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <stdio.h>

extern int func(); // Provided in liba.so, returns 42
extern int func(void); // Provided in liba.so, returns 42
typedef int (*fp_t)();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the typedef?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using SPIR-V to repro the issue and it compiled successfully with just the func change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need the void in the typedef too, otherwise it's a type mismatch. Most compilers will accept it. Clang just reports a warning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in latest commit, thanks!


int main() {
Expand Down
2 changes: 1 addition & 1 deletion offload/test/offloading/static_linking.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int foo() {
}
#else
#include <stdio.h>
int foo();
int foo(void);

int main() {
int x = foo();
Expand Down
Loading