btrfs-progs/image
Qu Wenruo c3a41e5d4c btrfs-progs: move a union with variable sized type to the end
[WARNING]
Clang 15.0.7 gives the following warning:

  image/main.c:95:2: warning: field '' with variable sized type 'union metadump_struct::(anonymous at image/main.c:95:2)' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
          union {
          ^

[CAUSE]
The union contains meta_cluster, which variable sized:

  struct meta_cluster {
  	struct meta_cluster_header header;
  	struct meta_cluster_item items[];
  } __attribute__ ((__packed__));

Thus clang gives above warning since it's a GNU extension.

[FIX]
Just move the union to the end of the structure.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-02-18 17:44:02 +01:00
..
Makefile btrfs-progs: build: add stub makefile to image and mkfs 2019-07-04 15:36:01 +02:00
main.c btrfs-progs: move a union with variable sized type to the end 2023-02-18 17:44:02 +01:00
metadump.h btrfs-progs: image: rename BLOCK_* to IMAGE_BLOCK_* for metadump 2022-11-28 18:57:43 +01:00
sanitize.c btrfs-progs: use template for out of memory error messages 2022-10-11 09:08:09 +02:00
sanitize.h btrfs-progs: image: update include lists 2022-10-11 09:06:12 +02:00