<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:24:44 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-51178] Add ability to disable specific compiler warnings-as-errors from SCons</title>
                <link>https://jira.mongodb.org/browse/SERVER-51178</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We currently have only two ways to disable compiler warnings-as-errors: either make &lt;b&gt;none&lt;/b&gt; of them errors using &lt;tt&gt;&amp;#45;&amp;#45;disable-warnings-as-errors&lt;/tt&gt; or disable &lt;b&gt;all&lt;/b&gt; errors with a compiler flag. There is no way to disable specific warnings-as-errors from the SCons command line due to the order of the compiler flags. This matters sometimes when we have a new issue pop up (such as in a new compiler version) where we want to see the warning but not fail the build.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1493341">SERVER-51178</key>
            <summary>Add ability to disable specific compiler warnings-as-errors from SCons</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-devplatform">[DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP)</assignee>
                                    <reporter username="ryan.egesdahl@mongodb.com">Ryan Egesdahl</reporter>
                        <labels>
                    </labels>
                <created>Mon, 28 Sep 2020 15:23:26 +0000</created>
                <updated>Fri, 27 Oct 2023 17:19:10 +0000</updated>
                            <resolved>Fri, 27 Oct 2023 17:19:10 +0000</resolved>
                                                                    <component>Build</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3550562" author="acm" created="Wed, 6 Jan 2021 15:18:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ryan.egesdahl&quot; class=&quot;user-hover&quot; rel=&quot;ryan.egesdahl&quot;&gt;ryan.egesdahl&lt;/a&gt; - Generally, I don&apos;t like providing &lt;tt&gt;&amp;#45;&amp;#45;option-to-do-something-to-flags&lt;/tt&gt; when the same effect can be achieved by simply adding &lt;tt&gt;FLAG=value&lt;/tt&gt; to the command line. Build system users in general (i.e. not just us) expect to be able to provide these sorts of flags via the usual command line mechanisms (CFLAGS, etc.). To the extent possible, we should be encouraging people to use them. The existence of &lt;tt&gt;&amp;#45;&amp;#45;disable-warnings-as-errors&lt;/tt&gt; is a consequence of the ordering bug around how we inject &lt;tt&gt;&amp;#45;Wall&lt;/tt&gt; and &lt;tt&gt;&amp;#45;Werror&lt;/tt&gt;. If we fixed that bug, we wouldn&apos;t actually need &lt;tt&gt;&amp;#45;&amp;#45;disable-warnings-as-errors&lt;/tt&gt; at all, because saying &lt;tt&gt;CCFLAGS=&amp;#45;Wno-error&lt;/tt&gt; or the Windows analogue would achieve the same effect. My suggestion is that we should in fact fix that bug, now, rather than trying to introduce a smart facility that &quot;knows&quot; even more about certain compilers and their options. &lt;/p&gt;</comment>
                            <comment id="3549052" author="ryan.egesdahl" created="Tue, 5 Jan 2021 16:57:57 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=acm&quot; class=&quot;user-hover&quot; rel=&quot;acm&quot;&gt;acm&lt;/a&gt; - For your second point, the &lt;tt&gt;-Wall&lt;/tt&gt; flag should only be in &lt;tt&gt;CCFLAGS&lt;/tt&gt; (which is where we have it now) because &lt;tt&gt;CCFLAGS&lt;/tt&gt; automatically applies to all stages of the compiler, which is what we want error and warning flags to do.&lt;/p&gt;

&lt;p&gt;To your first point, I don&apos;t think we actually need to work so hard to make this happen. I would prefer not to be teaching SCons about any of these flags. I originally imagined this as simply copying the flag name from the appropriate part of the error code into the list of suppressed errors and then constructing the correct arguments accordingly before inserting them into the right place in the compiler command. Clang, GCC, and MSVC should all have the property that the error message tells you what flag to use, and the flags are all fairly regular in their construction. If you get the argument(s) wrong, the compiler is going to be plenty verbose about what you did. I don&apos;t think SCons needs to be in the way here, and it&apos;s better to be simple where we can be.&lt;/p&gt;

&lt;p&gt;To your third point - we can simply have another argument with a similar structure that issues a &lt;tt&gt;-Wno-XXX&lt;/tt&gt; (or similar for MSVC) if we really want it. But I am not so sure we should be controlling such things via the compiler command like that. Suppressing an error is one thing, but telling the compiler we&apos;re smarter than it is strikes me as the wrong thing to do. I would much rather wait until we actually &lt;b&gt;need&lt;/b&gt; that functionality for some reason before we add it. I don&apos;t expect it would be complicated if we get error suppression right.&lt;/p&gt;</comment>
                            <comment id="3548678" author="acm" created="Tue, 5 Jan 2021 15:03:28 +0000"  >&lt;p&gt;Some background on this that I&apos;m transferring from &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51084&quot; title=&quot;MongoDB fails to compile on Mac with XCode 12.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51084&quot;&gt;&lt;del&gt;SERVER-51084&lt;/del&gt;&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;I wrote:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ryan Egesdahl - The warning flag ordering issue is a longstanding nuisance. We had a (not very detailed) ticket for that work, once: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9568&quot; title=&quot;Add new vars C and C++ warning flags to SCons build strings&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9568&quot;&gt;&lt;del&gt;SERVER-9568&lt;/del&gt;&lt;/a&gt;. Perhaps we should re-open it, because I agree that it is surprising that adding warnings suppressions to CXXFLAGS should work. Part of the issue, IIRC, is that CCFLAGS appears after CFLAGS or CXXFLAGS on the C&lt;span class=&quot;error&quot;&gt;&amp;#91;XX&amp;#93;&lt;/span&gt;COM variable expansion, meaning that if we add -Werror to CCFLAGS, it will always appear later on the compile line than the warning suppression you are trying to add with via CFLAGS or CXXFLAGS. And, if won&apos;t work to add your warning suppression flag to CCFLAGS on the command line either, because we AppendUnique -Werror. However, if we instead added -Werror to both CFLAGS and CXXFLAGS via Prepend, maybe it all works?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;And &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ryan.egesdahl&quot; class=&quot;user-hover&quot; rel=&quot;ryan.egesdahl&quot;&gt;ryan.egesdahl&lt;/a&gt; replied:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Andrew Morrow I think what we settled on was wanting to be able to add specific no-error flags to the build like this:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;buildscripts/scons.py --ssl --variables-files=etc/scons/xcode_macosx.vars --libc++ --detect-odr-violations --dbg=on --opt=off --ninja --build-tools=next --disable-warnings-as-errors=range-loop-analysis VARIANT_DIR=ninja generate-ninja&lt;/tt&gt;&lt;br/&gt;
The idea was that we could exclude specific warnings from being marked as errors until we could fix them but not affect anything else that might pop up. The ordering of -Wall in the arguments wasn&apos;t as much of a problem as being able to turn off specific warnings-as-errors, which weren&apos;t being added in the right place by CFLAGS/CXXFLAGS.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I&apos;ll admit I find the proposed solution (&lt;tt&gt;&amp;#45;&amp;#45;disable-warnings-as-errors=range-loop-analysis&lt;/tt&gt;) appealing, but there are a few things that give me pause:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;We will need to teach SCons about how to map each of these arguments into the appropriate warning suppression for Windows and gcc and clang. That isn&apos;t necessarily hard, but it is work.&lt;/li&gt;
	&lt;li&gt;There is an inherent ambiguity. On systems other than MSVC which distinguish the drivers for C and C&amp;#43;&amp;#43;, given &lt;tt&gt;&amp;#45;&amp;#45;disable-warnings-as-errors=x&lt;/tt&gt;, should we append &lt;tt&gt;&amp;#45;Wno-error=x&lt;/tt&gt; to &lt;tt&gt;CCFLAGS&lt;/tt&gt;, &lt;tt&gt;CFLAGS&lt;/tt&gt;, or &lt;tt&gt;CXXFLAGS&lt;/tt&gt;? Perhaps all of them? What if a finicky compiler rejects a C&amp;#43;&amp;#43; specific &lt;tt&gt;Wno-error&lt;/tt&gt; on C files, or vice versa, or starts to in the future?&lt;/li&gt;
	&lt;li&gt;There are cases where you don&apos;t just want to demote the warning back from error to warning, but to suppress the warning entirely, because it is interfering with, say icecream, or produces a hideous diagnostics. This flag can&apos;t handle that, so you still end up needing to manually inject warning control flags via one of &lt;tt&gt;CCFLAGS&lt;/tt&gt;, &lt;tt&gt;CFLAGS&lt;/tt&gt;, or &lt;tt&gt;CXXFLAGS&lt;/tt&gt;. I&apos;d prefer the mechanism to achieve both disabling a warning entirely and demoting it from an error to a warning be the same.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In general, I have a preference for treating flags to the control the compiler as passthroughs from the user to the extent that we can. Users of the build system need to be aware of how to use the command line ability to control C and C++ flags to achieve their aims. So, having thought about it, my preference would be that we repair the issue with where &lt;tt&gt;&amp;#45;Wall&lt;/tt&gt; and &lt;tt&gt;&amp;#45;Werror&lt;/tt&gt; appear on the command line so that overrides provided on the command line work as expected.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="74117">SERVER-9568</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                                                <inwardlinks description="split from">
                                        <issuelink>
            <issuekey id="1483047">SERVER-51084</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25130"><![CDATA[Server Development Platform]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 5 Jan 2021 15:03:28 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 5 weeks 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>iryna.zhuravlova@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 5 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-devplatform</customfieldvalue>
            <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>ryan.egesdahl@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hy93hr:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</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|hy8pr3:</customfieldvalue>

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