[LLVMbugs] [Bug 10347] New: Clang permits implicit conversion to 'noreturn' function pointer in C

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 12 18:28:31 PDT 2011


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

           Summary: Clang permits implicit conversion to 'noreturn'
                    function pointer in C
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu


Clang accepts this code in C mode:

int add(int);

void f0(__attribute__((noreturn)) int (*)(int));
void f1() {
  f0(&add);
}

but it should not, since it is unsafe to treat a pointer to a
possibly-returning function pointer as a function pointer that is known not to
return. We properly diagnose this in C++ mode.

-- 
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