4 ms·
The chosen example (printf) doesn't make D look very good compared to C. If I modify the example to include a simple type error: printf("Hello %s", 123);
by colonwqbang 7y ago
The chosen example (printf) doesn't make D look very good compared to C. If I modify the example to include a simple type error:
printf("Hello %s", 123);
Then the D version will still happily compile without warnings and will segfault.
Compiling with GCC -Wall -Werror, the type error is easily caught by the compiler.
- arunc 7y agoUse dmd master and you will have printf/scanf format argument validation [0]. [0] https://github.com/dlang/dmd/pull/10852 https://github.com/dlang/dmd/pull/10852
- WalterBright 7y agoYeah, I am glad we fixed that one.