<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 16, 2016 at 4:09 PM, Jordan Rose via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><blockquote type="cite"><div>On Feb 16, 2016, at 15:40, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">On Tue, Feb 16, 2016 at 3:34 PM, Jordan Rose via cfe-dev</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"><</span><a href="mailto:cfe-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">cfe-dev@lists.llvm.org</a><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">> wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>On Feb 16, 2016, at 13:49, Douglas Gregor <<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>> wrote:<br><br><br>On Feb 16, 2016, at 12:56 PM, Nico Weber <<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>> wrote:<br><br>Is this the only C extension you need for swift?<br><br><br>I believe that it’s the only non-attribute extension not covered by an<br>existing flag.<br><br>What about -fblocks?<br><br><br>This already has a flag, which Swift’s Clang importer can set if it’s<br>important. I haven’t heard a ton of demand for blocks outside of Darwin<br>clients.<br><br>If it's just typed enums and you don't think it'll become more over time, it<br>probably doesn't matter much all either way. If you think you'll need more<br>features over time, having some global toggle for this seems nice. It could<br>default to on for -std=gnuX (if you use this, you don't mind extensions) and<br>to off for -std=cX (if you use this, you probably want to use the language<br>as standardized), or something like that.<br><br><br>Swift’s Clang importer can certainly use -std=gnu<whatever>, and keep fixed<br>underlying types out of -std=c<X>.<br><br><br>I do want to mention that Clang has plenty of other Clang-only extensions<br>that we added to -std=gnu<whatever>.<br></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">That sounds like a bug. The difference between -std=cX and -std=gnuX</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">should be exactly the same as enabling a (hypothetical)</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">-fgnu-extensions (or perhaps -fgnu-compatibility) flag -- that is, it</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">should only enable GNU extensions. Do you have an example?</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></blockquote></div><br></div></div><div>I take it back; it seems we merely have Clang extensions that we added without <i>any</i> flags, other than -Wpedantic.</div></div></blockquote><div><br></div><div>Actually here's one where even -Wpedantic won't coax a warning out of clang:</div><div><br></div><div><div>Sean:~/tmp % cat testpedantic.c </div><div>__attribute__((enable_if(1, "foo")))</div><div>void bar() {</div><div>}</div><div><br></div><div>Sean:~/tmp % clang -c testpedantic.c -std=c11 -Wpedantic -pedantic<br></div><div>Sean:~/tmp % clang -c testpedantic.c -std=c11 -Wpedantic          </div><div>Sean:~/tmp % clang -c testpedantic.c -std=c99 -Wpedantic</div></div><div>Sean:~/tmp % </div><div><br></div><div>-- Sean Silva</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div> The closest thing is that we accept any constant-foldable integer as an array size in GNU mode, and our constant folding logic probably doesn't exactly match GCC's.</div><div><br></div><div>Although this seems wrong:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>  if (!LangOpts.GNUMode && !LangOpts.MSVCCompat)</div></div><div><div>    Builder.defineMacro("__STRICT_ANSI__");</div></div></blockquote><div><br></div><div>Given that, I'm not sure why this would be different from <a href="http://clang.llvm.org/docs/LanguageExtensions.html" target="_blank">any other Clang extension</a> that was added without a flag.</div><div><br></div><div>Jordan</div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>