Ada 编程/编译指示/规范化标量
外观
该编译指示 Normalize_Scalars 指示编译器用可预测的值初始化未初始化的标量变量。如果可能,编译器将选择超出范围的值。
pragma
Normalize_Scalars;
...
My_Variable : Positive; -- Oops, forgot to initialize this variable.
-- The compiler (may) initialize this to 0
...
-- Oops, using a variable before it is initialized!
-- An exception should be raised here, since the compiler
-- initialized the value to 0 - an out-of-range value for the Positive type.
Some_Other_Variable := My_Variable;