<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 --- - Provide a way to compile legacy code that uses argument-less return in non-void functions"
   href="http://llvm.org/bugs/show_bug.cgi?id=20532">20532</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Provide a way to compile legacy code that uses argument-less return in non-void functions
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>fuzxxl@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>Legacy code I try to compile (e.g. the Mosaic source code) contains code like
this:

    foo() {
        /* ... */
        return;
        /* ... */
    }

Which is, a return statement without an argument in a function of non-void
type. While gcc accepts such constructs, clang doesn't like them and promptly
refuses compilation:

    q.c:2:2: error: non-void function 'foo' should return a value
[-Wreturn-type]
            return;
            ^

Manually patching all places where such constructs appear is cumbersome. clang
should either provide a compiler flag that turns this kind of return-mismatch
into a warning, treating the returned value as undefined, and optionally accept
this kind of code by default if -std=gnu89 or -std=gnu99 is provided.</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>