<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 11/17/13 08:31, Renato Golin wrote:<br>
    </div>
    <blockquote
cite="mid:CAMSE1keqYPY568aFDZmKRxHf10DiUqrB6EK4RgCC8NQ9N5HbcQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On 17 November 2013 15:45, Behan
            Webster <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:behanw@converseincode.com" target="_blank">behanw@converseincode.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <div class="im">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div class="gmail_extra">
                        <div class="gmail_quote">
                          <div>So, in that case, you could have an #elif
                            __gcc with the GCC case and an #else with an
                            error message "Compiler doesnt support
                            builtin_whatever". Once the builtin is
                            accepted on both compilers, you can merge
                            them all, but still leave the #error, so
                            that new compilers will have a very nice
                            message telling them to implement the
                            builtin.</div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
                Hm. I see what you're suggesting. I suppose that would
                work.</div>
            </blockquote>
          </div>
          <br>
        </div>
        <div class="gmail_extra">I believe all compilers that claim GCC
          compatibility, including older versions of GCC, will set the
          same flags, so #ifs and #ifdefs should work with them. If the
          kernel is currently compiled with the "alternatives", it
          should just continue to do so.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">The problem arises if there are other
          compilers building the kernel that don't define __gcc etc BUT
          implement the necessary GCC-extensions (proprietary ones, like
          icc). My guess is that there aren't that many proprietary
          compilers that try to compile the kernel, but that could be an
          issue upstream.</div>
      </div>
    </blockquote>
    I don't know what icc does, and that theoretically still works (icc
    is still technically/theoretically the "second compiler" for the
    kernel). So I still lean to having the default case be the status
    quo (at least for the moment).<br>
    <br>
    My feeling at this point is enabling clang without breaking gcc (or
    anything else) is more important than absolute correctness.
    Essentially we need patches to be as easy to upstream as we can make
    them, with little to no breakage. Part of this is putting clang in
    the best possible light with little to no downside (breakage is a
    perceived downside). As much as I personally would prefer to have
    the kernel code follow the standard, as you know, it's not our call.
    I've used too many compilers to count, and so I personally
    appreciate standards based C code tremendously!<br>
    <br>
    Correctness will come. Especially when you end up with large bodies
    of people using clang with the kernel code (and not just gcc). Those
    are the people whom we are trying to enable. :)<br>
    <br>
    As far as icc is concerned we don't have the means to test our
    patches with it. The reality is that, while most devs are aware of
    icc, almost none of them give icc any thought when it comes to their
    code. Since few have access to icc, the feeling seems to be that if
    code breaks for icc, someone else will fix it. This is hardly ideal.<br>
    <br>
    I'm hoping that clang will become the "theoretical" second compiler.
    Essentially since both gcc and clang are now easily installable with
    your distro (or from llvm.org) that checking your code with either
    is straightforward. This will not only allow more people to use
    clang instead of gcc as their primary compiler, but also allow
    people who normally use gcc to also test with clang (if they choose
    to). I can imagine a future where testing with both gcc and clang
    before you upstream is encouraged. :)<br>
    <br>
    I understand that icc now uses the clang frontend for their
    compiler. So it seems that by enabling clang in the kernel we're
    likely also helping icc (which will also help our efforts).<br>
    <br>
    <blockquote
cite="mid:CAMSE1keqYPY568aFDZmKRxHf10DiUqrB6EK4RgCC8NQ9N5HbcQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">All that said, this is just bad
          practice, not broken code. So don't sweat too much about it.
          ;)</div>
      </div>
    </blockquote>
    Exactly. :)<br>
    <br>
    Behan<br>
    <pre class="moz-signature" cols="72">-- 
Behan Webster
<a class="moz-txt-link-abbreviated" href="mailto:behanw@converseincode.com">behanw@converseincode.com</a></pre>
  </body>
</html>