This is a complex one. I'm not sure if it's a bug in Idris, Bazel (the build system), or my use of Bazel, but ohad asked me to raise an issue for visibility. If it's not useful, feel free to close.
In this mwe repo I create two functions to index into an int* in C++. They are identical except the names. One is my_index, the other index.
When I run this code, the call to index segfaults before it enters the C function. This might be because there is an existing POSIX function index. However, in my much larger project, I was not seeing an error until I made a large change to a lot of code but not that function (I did change build files, I'm not sure how relevant that is). Also, when I list targets in my shared lib with nm -D, I don't see a definition for index if I omit that function. Unfortunately nm doesn't give me the function signature.
Curiously, when making the mwe, I discovered I can't reproduce this with gcc/g++, as they complain about conflicting declarations of index.
This is a complex one. I'm not sure if it's a bug in Idris, Bazel (the build system), or my use of Bazel, but ohad asked me to raise an issue for visibility. If it's not useful, feel free to close.
In this mwe repo I create two functions to index into an
int*
in C++. They are identical except the names. One ismy_index
, the otherindex
.When I run this code, the call to
index
segfaults before it enters the C function. This might be because there is an existing POSIX functionindex
. However, in my much larger project, I was not seeing an error until I made a large change to a lot of code but not that function (I did change build files, I'm not sure how relevant that is). Also, when I list targets in my shared lib withnm -D
, I don't see a definition forindex
if I omit that function. Unfortunatelynm
doesn't give me the function signature.Curiously, when making the mwe, I discovered I can't reproduce this with gcc/g++, as they complain about conflicting declarations of
index
.