[LLVMbugs] [Bug 7280] New: Clang emits warning instead of error for non-void return without value

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 2 00:46:50 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7280

           Summary: Clang emits warning instead of error for non-void
                    return without value
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rjmccall at apple.com
                CC: llvmbugs at cs.uiuc.edu


int test1() {
  return;
}

daysthatwere:clang rjmccall$ clang /tmp/red.c
/tmp/red.c:2:3: warning: non-void function 'test1' should return a value
      [-Wreturn-type]
  return;
  ^

This should really be a hard error.  I would change this in a heartbeat, but
I'm not sure what motivated us to implement it as a warning in the first place.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list