@@ -51,6 +51,24 @@ to make sure their systems do not continue running in the face of
51
51
"unreachable" conditions. (For example, see commits like `this one
52
52
<https://git.kernel.org/linus/d4689846881d160a4d12a514e991a740bcb5d65a> `_.)
53
53
54
+ uninitialized_var()
55
+ -------------------
56
+ For any compiler warnings about uninitialized variables, just add
57
+ an initializer. Using the uninitialized_var() macro (or similar
58
+ warning-silencing tricks) is dangerous as it papers over `real bugs
59
+ <https://lore.kernel.org/lkml/[email protected] /> `_
60
+ (or can in the future), and suppresses unrelated compiler warnings
61
+ (e.g. "unused variable"). If the compiler thinks it is uninitialized,
62
+ either simply initialize the variable or make compiler changes. Keep in
63
+ mind that in most cases, if an initialization is obviously redundant,
64
+ the compiler's dead-store elimination pass will make sure there are no
65
+ needless variable writes.
66
+
67
+ As Linus has said, this macro
68
+ `must <https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/ >`_
69
+ `be <https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/ >`_
70
+ `removed <https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ >`_.
71
+
54
72
open-coded arithmetic in allocator arguments
55
73
--------------------------------------------
56
74
Dynamic size calculations (especially multiplication) should not be
0 commit comments