<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Erroneous clang -Warray-bounds warning when preprocessing its own output (Triggered by ccache)"
   href="https://llvm.org/bugs/show_bug.cgi?id=26178">26178</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Erroneous clang -Warray-bounds warning when preprocessing its own output (Triggered by ccache)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>shlomif@shlomifish.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi all, please see:

* <a href="https://github.com/shlomif/ccache-clang-stray-Warray-bounds-warning-bug">https://github.com/shlomif/ccache-clang-stray-Warray-bounds-warning-bug</a>

* <a href="https://bugzilla.samba.org/show_bug.cgi?id=11674">https://bugzilla.samba.org/show_bug.cgi?id=11674</a>

When running the following command on the input (available using make bad
SYSTEM_CLANG=/path/to/clang:

/usr/bin/clang -Warray-bounds -DFCS_COMPILE_DEBUG_FUNCTIONS=1 \
-DFCS_DBM_USE_LIBAVL=1 -DFCS_DBM_WITHOUT_CACHES=1 -DFCS_DEBONDT_DELTA_STATES=1
\
 -O2 -g -DNDEBUG   -fvisibility=hidden -march=corei7-avx -fomit-frame-pointer \
-E pi_make_microsoft_freecell_board.c -o pi_make_microsoft_freecell_board.i &&
\
/usr/bin/clang -DFCS_COMPILE_DEBUG_FUNCTIONS=1 -DFCS_DBM_USE_LIBAVL=1 \
-DFCS_DBM_WITHOUT_CACHES=1 -DFCS_DEBONDT_DELTA_STATES=1  -O2 -g -DNDEBUG   \
-fvisibility=hidden -march=corei7-avx -fomit-frame-pointer -c \

I am getting a warning:

pi_make_microsoft_freecell_board.i
pi_make_microsoft_freecell_board.c:168:2087: warning: array index 3 is past the
      end of the array (which contains 3 elements) [-Warray-bounds]
  ...__result = (((const unsigned char *) (const char *) ("-t"))[3] -
__s2[3]...
                                                          ^      ~
1 warning generated.
shlomif@telaviv1:~/Download/unpack/ccache-clang-stray-Warray-bounds-warning-bug$ 

I'm on Mageia Linux x86-64 v6 using clang from llvm-3.7.1-3.mga6.src.rpm .

Please look into it. Thank to Joel Rosdahl for some investigation and insights.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>