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 warning C5208 on windows(stop the build process) #9145

Merged
merged 1 commit into from Nov 2, 2020

Conversation

kemen209
Copy link
Contributor

@kemen209 kemen209 commented Oct 28, 2020

Building QGC with visual studio 2019 ver 16.6(with x86-windows-msvc2017-64bit)(not vs2017) on Windows 10, it stop with warning C5208.

As state in Microsoft doc(https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5208?view=vs-2019), the fix is simple: add a name to struct typedef.

@DonLakeFlyer
Copy link
Contributor

The concept that somehow a struct name is required for a typedef seems odd to me. I can't seem to understand what that does is saying with respect to why it is needed. I wondering whether a better change is to add an ignore for the warning. Not sure if that is dangerous or not. Otherwise it seems like this is just going to keep popping up since QGC is not currently running against VS 2019 as it's supported compiler.

@kemen209
Copy link
Contributor Author

kemen209 commented Nov 1, 2020

As stated on Microsoft page, the Unnamed classes within a typedef declaration can't have any members other than:
non-static data members,
member classes,
member enumerations,
and default member initializers.

and the restriction is meant to ensure the simplicity of structs that have typedef names for linkage purposes. They must be simple enough that no linkage calculations are necessary before the compiler gets to the typedef name for linkage.

@kemen209
Copy link
Contributor Author

kemen209 commented Nov 1, 2020

I'm had little knowledge about the build process, so i don't know what is the proper way to ignore the warning. I will leave that to someone else.

@DonLakeFlyer
Copy link
Contributor

Ok, fine. We'll just go with adding the names then.

@DonLakeFlyer DonLakeFlyer merged commit 5b5fdf5 into mavlink:master Nov 2, 2020
AJRepo pushed a commit to AJRepo/qgroundcontrol that referenced this pull request Nov 16, 2020
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.

None yet

2 participants