Skip to content

Commit

Permalink
Unpack struct file_data
Browse files Browse the repository at this point in the history
Packing the structure brings no benefit on 32bit systems and plugs a
marginal hole of 4 bytes on 64bit architectures. It also creates a
misaligned starting point for the entries[] flex array at the end and
while this is typically not a problem for x86 it is reported by GCC
with the address-of-packed-member warning.

Closes #311
  • Loading branch information
dridi committed Sep 5, 2019
1 parent 26fbca7 commit 1fbf3c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/merge-file-parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct file_data
uint32_t file_name_offset;

struct line_entry entries[];
}__attribute__((packed));
};

// Unit test stuff
namespace merge_parser
Expand Down

0 comments on commit 1fbf3c8

Please sign in to comment.