<html>
    <head>
      <base href="http://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 --- - AND operator compiled like OR operator in FOR loop with text arrays"
   href="http://llvm.org/bugs/show_bug.cgi?id=21343">21343</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AND operator compiled like OR operator in FOR loop with text arrays
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>anton.travnikov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13237" name="attach_13237" title="Source code of my program">attachment 13237</a> <a href="attachment.cgi?id=13237&action=edit" title="Source code of my program">[details]</a></span>
Source code of my program

Hello!

I'm just learning to C and reads "K&R C" textbook. And while I'm did the 23rd
exercise (remove all comments from a C program), I am encountered with the
problem:
like you can see on 51-th string of attached program, me necessary use of OR
operator instead of AND in FOR loop, because OR operator in that case works
like AND and program works well. If I'm attempts to use WHILE loop instead of
FOR loop, thats mistake arise in WHILE loop (code of WHILE loop is commented,
and you can attempt use it instead of FOR). Strings number 49-50 and 58
contains debug code that prints values of variables, numbers of strings with
comments and control pair of characters in array (/* or */) before processed
text of C program.
If you attempt execute the program, at first whether with || and them with &&
in FOR loop or with WHILE loop with same couple of operands you will see vary.
My english is not so good, but I'm hope that you will understand :)
______

Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix</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>