11
29
Fork
You've already forked ipmitool
33

Establish a uniform structure packing syntax #29

Merged
AlexanderAmelkin merged 2 commits from Howitzer105mm/ipmitool:bugfix/28-use-uniform-packing-syntax into master 2024年03月26日 12:04:27 +01:00
Contributor
Copy link

The ipmitool source code has a mixed batch of different structure
packing code.

There is an #ifdef HAVE_PRAGMA_PACK control that does not work to
enable/disable #pragma pack.
There are instances of hard coded attribute entries.
There are hard coded enable/disable modes.

This commit creates a uniform structure.
The HAVE_PRAGMA_PACK in config.h correctly controls using the "#pragma
pack" or the attribute functionality.
Changes to packing via the pragma functionality is done using matched
push/pop actions to allow temporary override of packing. Prior packing
levels are then restored.

Signed-off-by: Johnathan Mantey johnathanx.mantey@intel.com

The ipmitool source code has a mixed batch of different structure packing code. There is an #ifdef HAVE_PRAGMA_PACK control that does not work to enable/disable #pragma pack. There are instances of hard coded __attribute__ entries. There are hard coded enable/disable modes. This commit creates a uniform structure. The HAVE_PRAGMA_PACK in config.h correctly controls using the "#pragma pack" or the __attribute__ functionality. Changes to packing via the pragma functionality is done using matched push/pop actions to allow temporary override of packing. Prior packing levels are then restored. Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
The ipmitool source code has a mixed batch of different structure
packing code.
There is an #ifdef HAVE_PRAGMA_PACK control that does not work to
enable/disable #pragma pack.
There are instances of hard coded __attribute__ entries.
There are hard coded enable/disable modes.
This commit creates a uniform structure.
The HAVE_PRAGMA_PACK in config.h correctly controls using the "#pragma
pack" or the __attribute__ functionality.
Changes to packing via the pragma functionality is done using matched
push/pop actions to allow temporary override of packing. Prior packing
levels are then restored.
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
AlexanderAmelkin left a comment
Copy link

A very good and useful change! Just please don't do 'collateral improvements' in the same commit. And fix the commit log summary, like in the other PRs.

A very good and useful change! Just please don't do 'collateral improvements' in the same commit. And fix the commit log summary, like in the other PRs.
@ -34,3 +34,3 @@
#endif
#pragma pack(1)
#include <ipmitool/ipmi_intf.h>

Does this have anything to do with structure packing?
If not, then please do warning cleanups in a separate commit.

Does this have anything to do with structure packing? If not, then please do warning cleanups in a separate commit.
Author
Contributor
Copy link

reverted.

reverted.
Howitzer105mm marked this conversation as resolved
@ -34,3 +34,2 @@
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#include <stdint.h>

Same question.

Same question.
Author
Contributor
Copy link

reverted.

reverted.
Howitzer105mm marked this conversation as resolved
@ -36,12 +36,13 @@
# include <config.h>
#endif
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>

Again

Again
Howitzer105mm marked this conversation as resolved
@ -6,3 +6,3 @@
#pragma once
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>

Again

Again
Author
Contributor
Copy link

reverted.

reverted.
Howitzer105mm marked this conversation as resolved
@ -42,1 +44,4 @@
#endif
#include <stddef.h>
#include <ipmitool/ipmi.h>

Again

Again
Howitzer105mm marked this conversation as resolved
@ -35,0 +35,4 @@
#if HAVE_CONFIG_H
#include <config.h>
#endif

Same

Same
Author
Contributor
Copy link

reverted.

reverted.
Howitzer105mm marked this conversation as resolved
@ -34,6 +34,7 @@
#include <ipmitool/helper.h>
#include "lanplus.h"
#include <ipmitool/ipmi_intf.h>

Again

Again
Author
Contributor
Copy link

reverted.

reverted.
Howitzer105mm marked this conversation as resolved
The ipmitool source code has a mixed batch of different structure
packing code.
There is an #ifdef HAVE_PRAGMA_PACK control that does not work to
enable/disable #pragma pack.
There are instances of hard coded __attribute__ entries.
There are hard coded enable/disable modes.
This commit creates a uniform structure.
The HAVE_PRAGMA_PACK in config.h correctly controls using the "#pragma
pack" or the __attribute__ functionality.
Changes to packing via the pragma functionality is done using matched
push/pop actions to allow temporary override of packing. Prior packing
levels are then restored.
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool!29
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "Howitzer105mm/ipmitool:bugfix/28-use-uniform-packing-syntax"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?