Trouble with Cortex-M "Hello World"

Dan Olson via Digitalmars-d digitalmars-d at
Tue Mar 31 08:50:15 PDT 2015

"Mike" <none at> writes:

> On Tuesday, 31 March 2015 at 10:39:05 UTC, Jens Bauer wrote:
>> Referring to the tutorial on this page:
>> <>
>> -I'm getting the following error:
>> start.d:45:11: error: mismatched array lengths, 0 and 3
>>    uint[3] message =
>>            ^
> [snip]
> I just cut and pasted the code from the wiki myself and compiled with
> my arm-none-eabi-gdc cross-compiler and it works fine.  I'm sorry, but
> I'm not sure what the problem could be.
> Mike

Yeah, something strange.  The start.d on the webpage compiles fine for
me too.  I am using LDC as cross compiler to ARM, but you should also be
able to compile start.d fine with regular dmd too even though it can't
target ARM.

It is as if your message array declaration line is being read by
compiler as:

    uint[0] message =

>> When I change the square brackets to parantheses, the error goes
>> away, but I'm not sure that is the correct fix ?

Changing the square brackets to parens is doing something different.
You do want the square brackets.

More information about the Digitalmars-d mailing list