-
Notifications
You must be signed in to change notification settings - Fork 120
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
Compiler warnings: formal parameter different from declaration #1512
Comments
@ahsonkhan didn't we decide to do away with right side |
I am fine with reverting #1261 and not have the right hand |
That said, the warning from MSVC is somewhat incorrect as it is flagging something that the standard (and other compilers) allow. |
New MSVC versions shouldn't warn, but old versions are still around. The bug was fixed less than a year ago, IIRC. |
I addressed this and other right hand const on parameters in APIs in the above PR. Let me know y'alls thoughts. |
@bo-ms, what version of VS 2019 are you on (I am on |
@danewalton #1517 fixed the compiler warning, could you apply it into feature/iot_pnp branch? thanks. |
@ahsonkhan I am on Visual Studio Enterprise 2019 version 16.2.0, and there is no warning in new version (16.8.1). |
OK, that's good to know. Thanks for confirming. Looks like the workaround for MSVC issue isn't absolutely necessary then. Correct me if I am wrong, but that means doing a one-off port of the commit from master isn't necessary atm. The change will get picked up whenever master is merged into the feature branch. Up to @danewalton when to do that, or to group them later, closer to the next release. |
I don't think there is harm in merging master changes into the feature branch on a regular basis. It honestly makes the merge changes easier to manage instead of one monolith near release times. |
tackled in #1520 |
I got following compiler warnings in Visual Stuido 2019. For example: the parameter parent in az_context_create_with_expiration() with different declarations in.c/.h
In_ az_context.h https://github.com/Azure/azure-sdk-for-c/blob/master/sdk/inc/azure/core/az_context.h#L65
In az_context.c https://github.com/Azure/azure-sdk-for-c/blob/master/sdk/src/azure/core/az_context.c#L58
Log:
1>------ Build started: Project: az_core, Configuration: Debug WIN32 ------
1>az_context.c
1>az_http_policy_logging.c
1>az_http_request.c
1>az_json_reader.c
1>az_json_token.c
1>az_json_writer.c
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_context.c(59,1): error C2220: warning treated as error - no 'object' file generated
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_context.c(59,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_context.c(70,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_context.c(88,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(44,1): error C2220: warning treated as error - no 'object' file generated
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(44,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(154,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_reader.c(18,1): error C2220: warning treated as error - no 'object' file generated
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_reader.c(18,1): warning C4028: formal parameter 3 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_reader.c(56,1): warning C4028: formal parameter 4 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(248,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(334,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(434,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(469,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_policy_logging.c(211,1): error C2220: warning treated as error - no 'object' file generated
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_writer.c(19,1): error C2220: warning treated as error - no 'object' file generated
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_policy_logging.c(211,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_writer.c(19,1): warning C4028: formal parameter 3 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_request.c(156,1): error C2220: warning treated as error - no 'object' file generated
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_writer.c(44,1): warning C4028: formal parameter 5 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_request.c(156,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_request.c(177,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_request.c(188,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(504,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_policy_logging.c(224,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_request.c(199,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_policy_logging.c(224,1): warning C4028: formal parameter 3 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_http_request.c(208,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(539,1): warning C4028: formal parameter 1 different from declaration
1>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\core\az_json_token.c(574,1): warning C4028: formal parameter 1 different from declaration
1>Done building project "az_core.vcxproj" -- FAILED.
2>------ Build started: Project: az_iot_hub, Configuration: Debug WIN32 ------
3>------ Build started: Project: az_iot_provisioning, Configuration: Debug WIN32 ------
2>az_iot_hub_client.c
3>az_iot_provisioning_client.c
3>az_iot_provisioning_client_sas.c
2>az_iot_hub_client_sas.c
2>az_iot_hub_client_telemetry.c
2>az_iot_hub_client_c2d.c
2>az_iot_hub_client_twin.c
2>az_iot_hub_client_methods.c
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client_sas.c(38,1): error C2220: warning treated as error - no 'object' file generated
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client_sas.c(38,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client_sas.c(79,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(55,1): error C2220: warning treated as error - no 'object' file generated
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(55,1): warning C4028: formal parameter 5 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_sas.c(41,1): error C2220: warning treated as error - no 'object' file generated
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_sas.c(41,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_sas.c(91,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_c2d.c(23,1): error C2220: warning treated as error - no 'object' file generated
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_c2d.c(23,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_twin.c(36,1): error C2220: warning treated as error - no 'object' file generated
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_twin.c(36,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_twin.c(76,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_twin.c(114,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_telemetry.c(26,1): error C2220: warning treated as error - no 'object' file generated
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_telemetry.c(26,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_telemetry.c(26,1): warning C4028: formal parameter 2 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client.c(39,1): error C2220: warning treated as error - no 'object' file generated
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client.c(39,1): warning C4028: formal parameter 4 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client.c(56,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client.c(139,1): warning C4028: formal parameter 1 different from declaration
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_methods.c(28,1): error C2220: warning treated as error - no 'object' file generated
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_methods.c(28,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(77,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(130,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(160,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(195,1): warning C4028: formal parameter 1 different from declaration
3>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_provisioning_client.c(516,1): warning C4028: formal parameter 1 different from declaration
3>Done building project "az_iot_provisioning.vcxproj" -- FAILED.
2>D:\code\netx\netxduo\addons\azure_iot\azure-sdk-for-c\sdk\src\azure\iot\az_iot_hub_client_methods.c(86,1): warning C4028: formal parameter 1 different from declaration
2>Done building project "az_iot_hub.vcxproj" -- FAILED.
4>------ Build started: Project: sample_azure_iot_embedded_sdk_pnp, Configuration: Debug WIN32 ------
4>main.c
4>sample_azure_iot_embedded_sdk_pnp.c
4>sample_device_identity.c
4>nx_azure_iot_cert.c
4>nx_azure_iot_ciphersuites.c
4>sample_azure_iot_embedded_sdk_pnp.vcxproj -> D:\code\netx\Test\Regression\azure_iot\project\cmake\build\Debug\sample_azure_iot_embedded_sdk_pnp.exe
========== Build: 1 succeeded, 3 failed, 7 up-to-date, 0 skipped ==========
The text was updated successfully, but these errors were encountered: