Skip to content

Commit

Permalink
errorlog: Prevent alignment error building with gcc9.
Browse files Browse the repository at this point in the history
Fixes this build error:
[ 52s] hw/fsp/fsp-elog-write.c: In function 'opal_elog_read':
[ 52s] hw/fsp/fsp-elog-write.c:213:12: error: taking address of packed member of 'struct errorlog' may result in an unaligned pointer value [-Werror=address-of-packed-member]
[ 52s] 213 | list_del(&log_data->link);
[ 52s] | ^~~~~~~~~~~~~~~

Fixes: #247
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
hramrach authored and oohal committed Aug 2, 2019
1 parent e9a30df commit 6080c10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/errorlog.h
Expand Up @@ -106,7 +106,7 @@ struct __attribute__((__packed__))elog_user_data_section {
* needs to populate this structure using pre-defined interfaces
* only
*/
struct __attribute__((__packed__)) errorlog {
struct __attribute__((__packed__)) __attribute__ ((aligned (8))) errorlog {

uint16_t component_id;
uint8_t error_event_type;
Expand Down

0 comments on commit 6080c10

Please sign in to comment.