Skip to content

Get rid of compilation warnings and set warnings as errors #13

Open
AlexanderAmelkin opened this issue May 31, 2018 · 0 comments
Open
Assignees
Labels
cleanup The issue is to clean up or refactor the existing code

Comments

@AlexanderAmelkin
Copy link
Contributor

There are myriads of warnings produced during compilation.
In order to make this tool behave more predictably and for overall cleanliness of the code it is required to thoughtfully and thoroughly get rid of all the warnings and prohibit introduction of new ones in future by treating warnings as errors in the compiler (-Werror).

vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 6, 2018
Several functions were passed a struct ipmi_intf* even though it was
unused. This removes the unused parameters and changes calls and
signatures.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 6, 2018
Some return values were being ignored in ipmi_start_daemon. This adds
checks to the values and changes some hard-coded numbers into named
values.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 6, 2018
In some of the SDR calculating code, there were switch statements that
had cases that would fall through deliberately into the next case.
Duplicating the code and adding a break is more deliberate and does not
actually change the code size because the compiler will optimize it out.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 6, 2018
There were many places in the code that have signed/unsigned
comparisons. The compiler was warning about these. There are a couple of
types of changes to fix this:
 * define values with an unsigned postfix u
 * declare size/offset types as size_t
 * cast on type to the other

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 7, 2018
Several functions were passed a struct ipmi_intf* even though it was
unused. This removes the unused parameters and changes calls and
signatures.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 7, 2018
Some return values were being ignored in ipmi_start_daemon. This adds
checks to the values and changes some hard-coded numbers into named
values.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 7, 2018
In some of the SDR calculating code, there were switch statements that
had cases that would fall through deliberately into the next case. But
the compiler didn't like the comment and would complain about the fall
through anyway. This changes to a comment that the compiler recognizes.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 7, 2018
There were many places in the code that have signed/unsigned
comparisons. The compiler was warning about these. There are a couple of
types of changes to fix this:
 * define values with an unsigned postfix u
 * declare size/offset types as size_t
 * cast on type to the other

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 9, 2018
Several functions were passed a struct ipmi_intf* even though it was
unused. This removes the unused parameters and changes calls and
signatures.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 9, 2018
Some return values were being ignored in ipmi_start_daemon. This adds
checks to the values and changes some hard-coded numbers into named
values.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
vmauery added a commit to vmauery/ipmitool that referenced this issue Nov 9, 2018
In some of the SDR calculating code, there were switch statements that
had cases that would fall through deliberately into the next case. But
the compiler didn't like the comment and would complain about the fall
through anyway. This changes to a comment that the compiler recognizes.

Partially resolves ipmitool#13

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cleanup The issue is to clean up or refactor the existing code
Projects
None yet
Development

No branches or pull requests

1 participant