Skip to content

Fixed compiler warnings in the c++ build#600

Open
MatthewHartley wants to merge 1 commit into
bfgroup:mainfrom
MatthewHartley:warning_cleanup
Open

Fixed compiler warnings in the c++ build#600
MatthewHartley wants to merge 1 commit into
bfgroup:mainfrom
MatthewHartley:warning_cleanup

Conversation

@MatthewHartley

Copy link
Copy Markdown

Proposed changes

When I was building this in my gentoo system, I was bombarded with compiler warnings that looked scary at first glance. This removes these warnings so that installs look less chaotic. One group of warnings was complaining that the order in which == operators were declared was undefined, so making all four equals/not equals operations in the value_ref class depend on a single function was fragile. To fix this, I implemented all 4 explicitly using the equal_to function. The other is another that enums need to be explicitly static_casted since direct adding between two different enum types is deprecated, now the only warning is about calling free on a heap object in a yyparse function, which from a cursory glance is the compiler not realizing that it only gets freed if it isn't a heap object

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I searched the discussions
  • I searched the closed and open issues
  • I read the contribution guidelines
  • I added myself to the copyright attributions for significant changes
  • I checked that tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • I added necessary documentation (if appropriate)

…complaining that the order in which == operators were declared was undefined, so making all four equals operations in the value_ref class depend on a single one was fragile and another that enums need to be explicitly static_casted since direct adding between two different enum types is deprecated, now the only warning is about calling free on a heap object in a yyparse function, which from a cursory glance is the compiler not realizing that it only gets freed if it isn't a heap object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant