-
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
Places where we have const* arguments in source, optionally mark the value as const as well. #1261
Conversation
value as const as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side Q: I'm intrigued that this compiles without changing header declarations. Do you know why that is?
I will quote @BillyONeal
I don't know the underlying compiler or language reason to exactly why that is (or the mechanism behind it), but if I had to guess, the generated assembly is going to be identical and the second |
C11 6.7.6.3 "Function declarators (including prototypes)"/15: The part I highlighted says that type qualifiers are removed from the declared type when determining whether function types are compatible. Note that the |
Thanks for this info. A spot I'm still a little confused on is the removing of qualifiers to determine if function types are compatible. Here's my question: If the qualifier (in this case const on the pointee) is removed prior to compatibility testing, then wouldn't that make |
@ahsonkhan are you thinking to also update the header files in a separate PR? |
Qualifiers on the pointee aren't qualifiers on the function argument, so they are not adjusted by the above wording.
No, because the |
Oh I get it now. I had it flipped. Thank you! |
No. That is intentionally not something we want to do as per our discussion/meeting last Friday. We don't want redundant use of Quoting @CIPop
http://www.gotw.ca/gotw/006.htm |
Sounds good. Tbh, there was so much back and forth, repetition and circling back around in that debate, I wasn't clear on the end result. |
@RickWinter, @ericwol-msft, @barcharcraz, @CIPop - please review. |
…o UseConstInSrc
Got confirmation from @ericwol-msft offline that this should wait until after GA. Please hold off on merging for now. |
…o UseConstInSrc
Hello @ahsonkhan! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…ark the value as const as well. (Azure#1261)" This reverts commit 5723678.
* Make sure we always log in as app or provisioner (#1480) This also adds previously-required parameters back into @PSBoundParameters to pass down to pre- and post-scripts. Co-authored-by: Heath Stewart <heaths@microsoft.com> * update changelog for beta 2 (#1484) * Sync eng/common directory with azure-sdk-tools for PR 1163 (#1483) * Update subscription configuration schema to include new parameters * Support platform specific arm template parameters and legacy hashtable format * Update arm template parameter comment to include top level key * Restore AdditionalParameters. Merge ArmTemplateParameters from stringified hash literal * Handle duplicate keys more explicitly for arm and env vars * Regenerate New-TestResources.ps1 markdown * revert variable name to environmentVariables to fix post-scripts * Handle empty arm template parameters better * Remove arm template parameter merge logic from deploy template * Add merge hashes function to New-TestResources.ps1 * Add merge hashes function to New-TestResources.ps1 * Add env variable overwrite warning. Use ContainsKey checks * Temporarily manually fix invalid generated markdown links Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> * Sync eng/common directory with azure-sdk-tools for PR 1178 (#1487) * Refactor eng/common/README.md * Add doc directory Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com> * Fix broken eng/common doc link (#1489) Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com> * Explicitly ignore return of _az_span_token on c2d parsing (#1482) (#1490) * add latest static analyzer fix to changelog (#1491) * Sync eng/common directory with azure-sdk-tools for PR 1188 (#1502) * Add debug flag to arm deployment command * Only set debug preference when $CI is true Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> * Remove invalid characters in basename sourced from username (#1503) Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> * Sync eng/common directory with azure-sdk-tools for PR 1170 (#1481) * Added the preprocess scripts. * string array to string Co-authored-by: Sima Zhu <sizhu@microsoft.com> * Reorganization of samples readme (#1505) * Completion of Sample Readme update (#1508) * Add Invoke-DevOpsAPI.ps1, Add functions for Canceling and Listing Builds (#1474) Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com> * Change live test resource DeleteAfterHours tag to 8 hours (#1509) Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> * adding notes about security on readme file (#1498) * adding notes about security on readme file * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Mollie Munoz <mollie.munoz@microsoft.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Mollie Munoz <mollie.munoz@microsoft.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Mollie Munoz <mollie.munoz@microsoft.com> * Update how_to_iot_hub_esp8266_nodemcu.md * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Eric Wolz <ericwol@microsoft.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Eric Wolz <ericwol@microsoft.com> * Update sdk/samples/iot/docs/how_to_iot_hub_esp8266_nodemcu.md Co-authored-by: Eric Wolz <ericwol@microsoft.com> Co-authored-by: Mollie Munoz <mollie.munoz@microsoft.com> Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com> Co-authored-by: Eric Wolz <ericwol@microsoft.com> * Sync eng/common directory with azure-sdk-tools for PR 1202 (#1510) * Add debugging link on resource deployment failures to log output * Update aka link for live test help docs. Use here string and empty throw. Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> * Sync eng/common directory with azure-sdk-tools for PR 1153 (#1513) * Improve Update-ChangeLog Logic * Updates to ChangeLog-Operations.ps1, copy-docs-to-blobstorage.ps1, Invoke-GitHubAPI.ps1 and Package-Properties.ps1 * More changeLog Logic Improvements * Update date parsing Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com> * Revert "Places where we have const* arguments in source, optionally mark the value as const as well. (#1261)" (#1517) This reverts commit 5723678. * Update AddAzureSDKforC.cmake to reference the latest tagged release of the SDK (#1495) * Update AddAzureSDKforC.cmake to reference the latest release of the SDK * Remove pnp from the tag being referenced. * Incrementing master CL and version to be above the next release from the feature branch (#1506) * Update LanguageSetting.ps1 (#1518) Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Heath Stewart <heaths@microsoft.com> Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com> Co-authored-by: ewertons <ewertons@microsoft.com> Co-authored-by: Sima Zhu <sizhu@microsoft.com> Co-authored-by: Mollie Munoz <mollie.munoz@microsoft.com> Co-authored-by: Wellington Duraes <wellington.duraes@gmail.com> Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com> Co-authored-by: Eric Wolz <ericwol@microsoft.com> Co-authored-by: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com>
Used this regex:
const\* (?!const)
->const* const
on*.c
files excludingsdk\tests, sdk\samples
, and intentionally skipping*.h
files