<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:37:49 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-15368] Banish C-style casts under src/mongo</title>
                <link>https://jira.mongodb.org/browse/SERVER-15368</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;C-style casts are, for very good reasons, prohibited by our coding guidelines (see &lt;a href=&quot;http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Casting&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Casting&lt;/a&gt;), yet they are pervasive in our codebase.&lt;/p&gt;

&lt;p&gt;There is a compiler flag, -Wold-style-casts, that can be used to prohibit their usage. However, we cannot enable that flag until we remove all of the existing C-style casts.&lt;/p&gt;

&lt;p&gt;To do so, we either need to&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Use a linter that can detect them, like clang-tidy, and fix them up manually.&lt;/li&gt;
	&lt;li&gt;Write a clang tool that does source to source transformations and re-writes the C style casts to the appropriate C++ style cast.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;To make -Wold-style-casts effective, we will probably also need to figure out how to make the compiler consider headers coming from src/third_party to be &apos;system&apos; headers, for which warnings are not issued. We probably want to do this anyway since we frequently encounter warnings in third_party code. Currently, we end up doing global suppressions for those warnings, but we would not need to do so if we treated src/third_party as a system header.&lt;/p&gt;</description>
                <environment></environment>
        <key id="159937">SERVER-15368</key>
            <summary>Banish C-style casts under src/mongo</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="12300">Won&apos;t Do</resolution>
                                        <assignee username="backlog-server-platform">DO NOT USE - Backlog - Platform Team</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Sep 2014 13:41:10 +0000</created>
                <updated>Wed, 27 Oct 2021 17:23:40 +0000</updated>
                            <resolved>Wed, 27 Oct 2021 17:23:40 +0000</resolved>
                                                    <fixVersion>features we&amp;#39;re not sure of</fixVersion>
                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="735509" author="xgen-internal-githook" created="Tue, 7 Oct 2014 14:36:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;andy10gen&apos;, u&apos;name&apos;: u&apos;Andy Schwerin&apos;, u&apos;email&apos;: u&apos;schwerin@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-15368&quot; title=&quot;Banish C-style casts under src/mongo&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-15368&quot;&gt;&lt;del&gt;SERVER-15368&lt;/del&gt;&lt;/a&gt; Remove C-style bool and void casts in assert utilities and likely macros.&lt;/p&gt;

&lt;p&gt;Also, move MONGO_likely/MONGO_unlikely to platform/compiler.h out of bson/inline_decls.h.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/64f8c8c82fc0bb109abf561301360d9a61b9825d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/64f8c8c82fc0bb109abf561301360d9a61b9825d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="734074" author="asya" created="Fri, 3 Oct 2014 23:03:36 +0000"  >&lt;p&gt;Here is the result set after pruning out various C++ casts for now, and anything inside macros (for now).   We&apos;re down to 431 instances of C-style casts.  &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://coverity.mongodb.com/reports.htm#v10007/p10035/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://coverity.mongodb.com/reports.htm#v10007/p10035/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="733031" author="asya" created="Thu, 2 Oct 2014 21:21:25 +0000"  >&lt;p&gt;I ran a checker flagging all occurrences of manual casts, was a little shocked by over 25K occurrences till I realized the counts included all the third party code.&lt;/p&gt;

&lt;p&gt;For our own code, it&apos;s just over 8,000 defects in about 600 files, which still seems like a lot...&lt;/p&gt;
</comment>
                            <comment id="729089" author="asya" created="Mon, 29 Sep 2014 03:04:46 +0000"  >&lt;p&gt;Let me see if I can do it in the next few days - we only show src/mongo defects in the UI for all checkers though, so that would be no different here.&lt;/p&gt;</comment>
                            <comment id="726901" author="acm" created="Thu, 25 Sep 2014 12:53:43 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=asya%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;asya@mongodb.com&quot;&gt;asya@mongodb.com&lt;/a&gt; That might be very useful if it is easy to do as a one-off. We would need to restrict or filter the report to only apply to src/mongo so we don&apos;t get overwhelmed with data about boost and v8, etc.&lt;/p&gt;</comment>
                            <comment id="726783" author="asya" created="Thu, 25 Sep 2014 06:37:01 +0000"  >&lt;p&gt;I think can run a checker in Coverity that flags all such casts - I&apos;m pretty sure that was one of the standard SDK example checkers...&lt;/p&gt;
</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 25 Sep 2014 06:37:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 19 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 19 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-platform</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlncn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9jdj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>139277</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrktcv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>