J
Juha Nieminen
Bo Persson said:Or, more likely, the host hardware might trap invalid values. I
believe that is the major reason for this being UB.
I don't think primitive types nor POD structs (ie. structs containing
only primitive types and other POD structs as members) *can* have invalid
values, no matter what you do (at least not in any hardware I know of).
Hence it's not possible for an uninitialized primitive type to cause
any kind of system signal to be thrown or whatever.
(But I suppose that the standard leaves it open for some exotic hardware
to support invalid values of 'int', for example.)