<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Combo reply...<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 12, 2017, at 3:58 PM, Chris Lattner via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Jul 12, 2017, at 3:03 PM, Jordan Rose via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space;">[Proposal:&nbsp;<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0181-package-manager-cpp-language-version.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0181-package-manager-cpp-language-version.md</a>]<div class=""><br class=""></div><div class="">I don't feel like I have the perspective for broad comments on the use cases for the proposal, but here are some low-level thoughts:</div><div class=""><br class=""></div><div class=""><pre class="" style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; color: rgb(36, 41, 46);"><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">public</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">enum</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">CLanguageStandard</span> {
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">c89</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">c90</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">iso9899_1990</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">iso9899_199409</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnu89</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnu90</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">c99</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">iso9899_1999</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnu99</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">c11</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">iso9899_2011</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnu11</span>
}
</pre></div><div class=""><br class=""></div><div class="">I don't think it's worth having every name and every alias here. c89/gnu89, c99/gnu99, and c11/gnu11 covers all of the variants and is what's used most in practice anyway. (IIRC C89 and C90 have some tiny difference from the second standardization, but Clang ignores this difference anyway.)</div></div></div></blockquote><div class=""><br class=""></div><div class="">I agree. &nbsp;It would be worth considering splitting this into two different dimensions: base language standard (90, 94, 99, 11) vs gnu/clang extensions (on/off). &nbsp;GNU extensions are generally compatible with non-extensions, so you may be able to get away with them always being enabled.</div></div></div></blockquote><div><br class=""></div>I initially thought the same thing (we should avoid the aliases and simplify as much as possible).</div><div><br class=""></div><div>However, I also have a guiding philosophy that "eventually" it should be possible to target everything the tools can do with SwiftPM (consider the use case of a compiler engineer wanting to test the behavior of iso9899:1999 mode, for whatever obnoxious reason). After thinking about it more I felt that supporting all of the non-deprecated GCC/Clang modes had little downsides, and was easier to justify in terms of this philosophy. The other alternative would be to support a limited set of modes and then an "other(String)" case, but I prefer this solution to that.</div><div><br class=""></div><div>Given that we anticipate replacing this case with a more comprehensive "build setting" feature at some point, I would rather KISS which in this case means making the enum definitions 1:1 with the GCC/Clang ones.</div><div><br class=""></div><div>Completely disregarding the GNU/Clang extension modes (and forcing it on where supported) and then dropping down to the minimal "useful" set (C{89,9911}, C++{98,03,11,14,1z}) would also be fine with me, but it is marginally more complicated to implement/explain and I'm not sure worth it.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space;"><div class=""><pre class="" style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; font-stretch: normal; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; color: rgb(36, 41, 46);"><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">public</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">enum</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(111, 66, 193);">CXXLanguageStandard</span> {
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">cxx98</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">cxx03</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnucxx98</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnucxx03</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">cxx11</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnucxx11</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">cxx14</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnucxx14</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">cxx1z</span>
    <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">case</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">gnucxx1z</span>
}</pre><div class=""><br class=""></div></div><div class="">Similar thoughts here. I also wonder if "gnucxx98" is redundant, given that it's already in a containing enum called "CXXLanguageStandard" (or "CPPLanguageStandard", or even "CPlusPlusLanguageStandard", depending on how that discussion goes). "gnu98" seems sufficient.</div></div></div></blockquote></div></div></blockquote><div><br class=""></div>It is redundant, but it also has a very clear mapping to the GCC/Clang values. What would you call the enum values to take advantage of this duplication?</div><div><br class=""></div><div>&nbsp;- Daniel</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><br class=""></div><div class="">Likewise with the above, this could be much simpler.</div></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-Chris</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-build-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-build-dev@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">swift-build-dev@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a></div></blockquote></div><br class=""></div></body></html>