forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commit6a9746f
USB: atm: Replace zero-length array with flexible-array member
The current codebase makes use of the zero-length array languageextension to the C90 standard, but the preferred mechanism to declarevariable-length types such as these ones is a flexible array member[1][2],introduced in C99:struct foo { int stuff; struct boo array[];};By making use of the mechanism above, we will get a compiler warningin case the flexible array does not occur last in the structure, whichwill help us prevent some kind of undefined behavior bugs from beinginadvertenly introduced[3] to the codebase from now on.This issue was found with the help of Coccinelle.[1]https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html[2]KSPP#21[3] commit7649773 ("cxgb3/l2t: Fix undefined behaviour")Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>Link:https://lore.kernel.org/r/20200211232148.GA20644@embeddedorSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parentd80bdab commit6a9746f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
0 commit comments
Comments
(0)