5 ms·
- define the evaluation order for function parameters, e.g. f(a(), b()) [or is that well defined in modern C++?] - allow for named arguments. E.g. let's say fo
by archi42 4y ago
- define the evaluation order for function parameters, e.g. f(a(), b()) [or is that well defined in modern C++?]
- allow for named arguments. E.g. let's say for the definition f(int a = 12, int b = 42), one might call f(b: 1337) or f(12, 1337). Not allowing mixing of named & positional is probably a good idea.
- take a look at static verification and remove language features that make static verification more difficult and think about how you could replace them (or remove; but e.g. function pointers & similar stuff fall in that category and are probably to powerful to be sacrificed this way)
//Edit: as others have said, try to whack as much undefined behaviour as possible (and in case you can't, don't accept the input program).
- compiler-devel 4y agoCompletely agree! Thank you for these suggestions.
- archi42 4y agoBtw, a lot of bad things are already present as compile time warnings. Using -Wall -Werror (or similar) should already the default for new projects for well over a decade. You probably know that, but "stealing" stuff from there is also a good idea. Plus, iirc, there are several additional warning options that are not contained in -Wall. Maybe you want to add some of these, too.
- compiler-devel 4y agoGreat suggestion.