]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hardlink: use flexible array member rather than zero-size array
authorSami Kerola <kerolasa@iki.fi>
Sat, 27 Apr 2019 08:54:05 +0000 (09:54 +0100)
committerSami Kerola <kerolasa@iki.fi>
Wed, 1 May 2019 18:37:54 +0000 (19:37 +0100)
This fixes two standards compliancy warnings.

hardlink.c:65:7: warning: ISO C forbids zero-size array ‘name’ [-Wpedantic]

Reference: https://en.wikipedia.org/wiki/Flexible_array_member
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/hardlink.c

index 953b3b7f91efc82fc813f3c053cee075592691f7..d64472e3fd3d8e5081756a244476ac677ff7f4a6 100644 (file)
@@ -62,7 +62,7 @@ struct hardlink_hash {
 
 struct hardlink_dir {
        struct hardlink_dir *next;
-       char name[0];
+       char name[];
 };
 
 struct hardlink_file {
@@ -70,7 +70,7 @@ struct hardlink_file {
        ino_t ino;
        dev_t dev;
        unsigned int cksum;
-       char name[0];
+       char name[];
 };
 
 struct hardlink_dynstr {