betterC mode and std.stdio File

samrose samroseahmed at gmail.com
Sat May 16 23:00:46 UTC 2020


I was writing some D with the -betterC option, which is quite 
nice. I was wondering if it is possible to use std.stdio File 
reading with the -betterC option.

It is working with -debug mode build but I get an error when 
building with release:

```
/usr/local/opt/dmd/include/dlang/dmd/std/exception.d(516,9): 
Error: Cannot use throw statements with -betterC
/usr/local/opt/dmd/include/dlang/dmd/std/exception.d(437,21): 
Error: template instance std.exception.bailOut!(ErrnoException) 
error instantiating
```

which seems to be cause by the stdio code using exceptions which 
doesn't work for betterC.


More information about the Digitalmars-d-learn mailing list