BetterC unexpected results

DLearner bmqazwsx123 at gmail.com
Wed Jan 11 15:51:25 UTC 2023


On Sunday, 8 January 2023 at 23:59:21 UTC, ryuukk_ wrote:
[...]
>> Example_03:
>> ```
>> void main() {
>>    import core.stdc.stdio : printf;
>>    int[] A;
>>    printf("Hello betterC\n");
>> }
>> ```
>>
>> ```
>> dmd -betterC -run Example_03
>> ```
>>
>> Expected result: Failure at compilation stage, owing to 
>> presence of dynamic array A, when -betterC set.
>> Actual result: Failed at link (not compilation) stage.
>
> That example is working for me
>
> What's the exact code you wrote?

```
void main() {
    import core.stdc.stdio : printf;
    int[] A;
    printf("Hello betterC\n");
}
```

Result:

```
C:\Users\SoftDev\Documents\BDM\D\BetterC>dmd -betterC -run 
Example_03
lld-link: error: undefined symbol: __d_run_main
>>> referenced by Example_03.obj:(_main)
Error: linker exited with status 1
```

Compiler version:
```
C:\Users\SoftDev\Documents\BDM\D\BetterC>dmd --version
DMD32 D Compiler v2.100.2-dirty
```


More information about the Digitalmars-d-learn mailing list