3 ms·
According to your definition everything is undefined behaviour. Imagine a simple program that successfully halts if it's input is empty and returns an error if
by imtringued 4y ago
According to your definition everything is undefined behaviour.
Imagine a simple program that successfully halts if it's input is empty and returns an error if it's input is no empty.
C adds a third state undefined. When you reach this state you know nothing about what is happening in the program.
Now Vale adds a third state called "memory error" which is just a refined error and well defined. This means that if you have handled the error case, you already handled the memory error case even if not in a satisfactory way.
What is strange to me is that you consider the former okay and the latter undefined behaviour in the application logic when it just means that an additional exit state has been added which a highly defined behaviour.