<div dir="ltr">I put together a patch for this here:<div><a href="https://reviews.llvm.org/D68055">https://reviews.llvm.org/D68055</a><br></div><div>By default clang will continue to claim to be GCC version 4.2.1, so there is no change if you don't pass the flag.</div><div><br></div><div>I originally came at this from the angle of wanting a language option that affirmatively says "yes, enable GCC-compatible extensions". Today a lot of GCC-isms are controlled by !-fms-compatibility, which is not so good if you ever try turning off MSVC compatibility. I propose that the presence of the new flag should control the various __GXX* macros we set, as is done in the patch. </div><div><br></div><div>Separately, folks periodically have issues with clang's advertised GCC version:</div><div><a href="http://lists.llvm.org/pipermail/cfe-dev/2019-July/062890.html">http://lists.llvm.org/pipermail/cfe-dev/2019-July/062890.html</a><br></div><div><a href="https://llvm.org/">https://llvm.org/</a><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">PR42817</span></div><div><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">This gives users an easier way to control that aside from -U__GNUC__ -D__GNUC__=5 etc. It also gives us a way of easily testing different __GNUC__ values without rebuilding clang. Maybe one day we could even stop defining __GNUC__ by default. =P</span></div><div><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">There's no major functionality change here, but I figured I should raise awareness about this flag and maybe add it to our release notes.</span></div></div>