Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with -Wunused-variable #1714

Merged
merged 1 commit into from
Jun 21, 2021
Merged

Conversation

attilaolah
Copy link

When compiling with -Wunused-variable, EXT_STRERROR_R_CHAR_P gets undefined because of a failing compilation check.

An alternative would be to return c ? 0 : 0, which works with compilers that do not have __attribute__((undefined)), but recent compilers seem to support this and the __attribute__ approach seems cleaner.

@kmilos
Copy link
Collaborator

kmilos commented Jun 14, 2021

Don't think this'll fly w/ MSVC, right? Inserting (void)c; doesn't work?

Then again, looks like strerror_r is not available in Windows anyway, but still nicer to have the test fail because of the actual missing method rather than the compiler...

@attilaolah
Copy link
Author

Good point, (void)c works too. I'll update this PR.

When compiling with -Wunused-variable, `EXT_STRERROR_R_CHAR_P` gets undefined because of a failing compilation check.

An alternative would be to mark `c` as `__attribute__((undefined))`, but MSVC doesn't have `__attribute__((undefined))`.
@attilaolah
Copy link
Author

PTAL.

@codecov
Copy link

codecov bot commented Jun 14, 2021

Codecov Report

Merging #1714 (33419c8) into main (19000cd) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1714   +/-   ##
=======================================
  Coverage   66.89%   66.89%           
=======================================
  Files         151      151           
  Lines       20761    20761           
=======================================
  Hits        13889    13889           
  Misses       6872     6872           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19000cd...33419c8. Read the comment docs.

Copy link
Member

@hassec hassec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution! 👍

@hassec hassec merged commit 653c569 into Exiv2:main Jun 21, 2021
@hassec
Copy link
Member

hassec commented Jun 21, 2021

@Mergifyio backport 0.27-maintenance

@mergify
Copy link
Contributor

mergify bot commented Jun 21, 2021

Command backport 0.27-maintenance: success

Backports have been created

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.

3 participants