[LLVMbugs] [Bug 12269] New: Option to trap on non-value preserving implicit cast

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 14 16:28:51 PDT 2012


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

             Bug #: 12269
           Summary: Option to trap on non-value preserving implicit cast
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: joerg at NetBSD.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Consider something like:

char foo(int x)
{
    return x;
}

This triggers the -Wconversion warning, but cleaning those up tends to clutter
up code a lot. It would be nice to have something -ftrapv for implicit casts,
i.e. actively check if the range of x fits the range of char and trap if it is
outside.

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