Am 16.07.2017 um 21:08 schrieb Ondrej Pokorny:
> On 16.07.2017 20:42, Florian Klämpfl wrote:
>> "Ungültiger Maschinenbefehl (Speicherabzug geschrieben)" = Invalid
>> opcode (memory dump written).
>> Why? Because it does not range check before entering the jump table.
> 
> OK, I confess I am not a C guy (I hated it in the university even more
> than fortran). But for me:

...

> 
> ondrej@ondrej-linux:~/ctest$ gcc test.c
> ondrej@ondrej-linux:~/ctest$ ./a.out
> defaultondrej@ondrej-linux:~/ctest$
> 
> No error if I remove the default statement.

Indeed. This proves the exactly point. Undefined behaviour. The code
behaves randomly dependent on the compiler used and even the optimizer
switches.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to