On Friday, 31 August 2018 at 06:20:09 UTC, James Blachly wrote:
Hi all,
I am linking to a C library which defines a symbol,
const char seq_nt16_str[] = "=ACMGRSVTWYHKDBN";
In the C sources, this is an array of 16 bytes (17 I guess,
because it is written as a string).
In the C headers, it is
On 8/31/18 1:18 PM, Neia Neutuladh wrote:
On Friday, 31 August 2018 at 06:20:09 UTC, James Blachly wrote:
Hi all,
I am linking to a C library which defines a symbol,
const char seq_nt16_str[] = "=ACMGRSVTWYHKDBN";
In the C sources, this is an array of 16 bytes (17 I guess, because it
is writ
On 8/31/18 2:20 AM, James Blachly wrote:
Hi all,
I am linking to a C library which defines a symbol,
const char seq_nt16_str[] = "=ACMGRSVTWYHKDBN";
In the C sources, this is an array of 16 bytes (17 I guess, because it
is written as a string).
In the C headers, it is listed as extern const
On Friday, 31 August 2018 at 06:20:09 UTC, James Blachly wrote:
Hi all,
I am linking to a C library which defines a symbol,
const char seq_nt16_str[] = "=ACMGRSVTWYHKDBN";
In the C sources, this is an array of 16 bytes (17 I guess,
because it is written as a string).
In the C headers, it is
On Friday, 31 August 2018 at 17:18:58 UTC, Neia Neutuladh wrote:
On Friday, 31 August 2018 at 06:20:09 UTC, James Blachly wrote:
Hi all,
...
When linking to this library from D, I have declared it as:
extern __gshared const(char)* seq_nt16_str;
***But this segfaults when I treat it like an a
On Friday, 31 August 2018 at 17:50:17 UTC, Steven Schveighoffer
wrote:
What the C compiler is doing is storing it as data, and then
storing the symbol to point at the first element in the data.
When you use const char* in D, it's expecting a *pointer* to be
stored at that address, not the data
On Friday, 31 August 2018 at 17:50:17 UTC, Steven Schveighoffer
wrote:
...
When you use const char* in D, it's expecting a *pointer* to be
stored at that address, not the data itself. So using it means
segfault. The static array is the correct translation, even
though it leaks implementation d
On Friday, 31 August 2018 at 18:49:26 UTC, James Blachly wrote:
On Friday, 31 August 2018 at 17:18:58 UTC, Neia Neutuladh wrote:
On Friday, 31 August 2018 at 06:20:09 UTC, James Blachly wrote:
Hi all,
...
When linking to this library from D, I have declared it as:
extern __gshared const(char