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

COMP: explicitly handle all enum cases in switch #2

Open
wants to merge 1 commit into
base: slicer-v3.4.0-2019-06-11-614110e7
Choose a base branch
from

Conversation

pieper
Copy link
Member

@pieper pieper commented Jun 7, 2020

In VisualStudio 2019 error C4061 happens if you don't
have a case statement for every value of an enum.
The default condition is not enough.

This fix avoids error like this:

25>C:\sq5\LibArchive\libarchive\archive_read_support_format_warc.c(344,2): error C4061: enumerator 'WT_NONE' in switch of enum 'warc_type_t' is not explicitly handled by a case label [C:\sq5\LibArchive-build\libarchive\archive.vcxproj]

In VisualStudio 2019 error C4061 happens if you don't
have a case statement for every value of an enum.
The default condition is not enough.

This fix avoids error like this:

25>C:\sq5\LibArchive\libarchive\archive_read_support_format_warc.c(344,2): error C4061: enumerator 'WT_NONE' in switch of enum 'warc_type_t' is not explicitly handled by a case label [C:\sq5\LibArchive-build\libarchive\archive.vcxproj]
@pieper
Copy link
Member Author

pieper commented Jun 7, 2020

This should really be moved upstream, since it seems not to have been fixed there.

https://github.com/libarchive/libarchive/blob/master/libarchive/archive_read_support_format_warc.c#L307-L344

Let's not merge this, but keep this open in case anyone else hits the same issue before it's fixes upstream.

@jcfr
Copy link
Member

jcfr commented Jun 8, 2020

Thanks for the fix.

If you have some more time to work on this, could you also submit a PR on https://github.com/libarchive/libarchive ?

Once done, you would change the commit title in our fork to [backport PR XXX] COMP: explicitly handle all enum cases in switch

@pieper
Copy link
Member Author

pieper commented Jun 8, 2020

Yes, that's the plan. I filed the issue upstream but not a PR yet. I was trying to fix the Chest Imaging Platform builds on windows when this cropped up so I wanted to make sure all the builds completed.

@jcfr
Copy link
Member

jcfr commented Jun 8, 2020

fix the Chest Imaging Platform builds on windows

That is great !

Once the extension is working again, I wonder if it could be used to process some COVID related data and gain some insight on the diseases.

@pieper
Copy link
Member Author

pieper commented Jun 8, 2020

Once the extension is working again, I wonder if it could be used to process some COVID related data and gain some insight on the diseases.

Yes, I hope so too!

@pieper pieper closed this Jun 8, 2020
@pieper pieper reopened this Jun 8, 2020
@pieper
Copy link
Member Author

pieper commented Jun 14, 2020

Upstream PR created: libarchive#1395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants