[Dll] Inconsistent annotations reported under visual studio 2019

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Dll] Inconsistent annotations reported under visual studio 2019

Boost - Users mailing list

Hi all,

 

Whilst compiling a plugin in release mode with boost.dll 1.70 using Visual Studio 2019 and the latest Windows sdk, I’m getting several inconsistent annotation errors for functions like LoadLibraryA/W.

 

Before I go to the trouble of creating a reproducible project and filing an issue, I wondered whether this is something that is know about and possibly fixed in 1.71

 

Any help appreciated.

 

Kind regards

Sean.


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [Dll] Inconsistent annotations reported under visual studio 2019

Boost - Users mailing list
On 18/08/2019 22:51, Sean Farrow wrote:
> Whilst compiling a plugin in release mode with boost.dll 1.70 using
> Visual Studio 2019 and the latest Windows sdk, I’m getting several
> inconsistent annotation errors for functions like LoadLibraryA/W.
>
> Before I go to the trouble of creating a reproducible project and filing
> an issue, I wondered whether this is something that is know about and
> possibly fixed in 1.71

It's because Boost uses an incomplete copy of the method prototypes for
various WinAPI functions to avoid pulling a dependency on the platform
SDK.  (I'm not entirely sure why, but I assume there was a reason.)

They're sufficiently correct that it won't cause incorrect runtime
behaviour, but can lead to those sorts of warnings since they don't have
the same attributes.

Usually you can ignore that unless you're making use of VS's static
analysis features.

You should be able to resolve it by adding BOOST_USE_WINDOWS_H to the
Preprocessor Definitions of your projects that include Boost, or by
#defining that before including any Boost headers.


If you want to file an issue about the differences, the appropriate
place is https://github.com/boostorg/winapi
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users