[LLVMbugs] [Bug 9466] New: clang: doesn't know about %Lu, %Ld, and %Lx

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 12 01:57:40 PST 2011


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

           Summary: clang: doesn't know about %Lu, %Ld, and %Lx
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 4068


When building Linux kernel there are lots of warnings like this:
arch/x86/kernel/module.c:177:55: warning: length modifier 'L' results in
undefined behavior or no effect with 'x' conversion specifier [-Wformat]
        printk(KERN_ERR "overflow in relocation type %d val %Lx\n",
                                                            ~^~

The Linux kernel's implementation of printf allows for %L use with integers (it
acts as long long), so there is no undefined behaviour.

Also if you look at GNU libc manual on printf it accepts %Ld:
http://www.gnu.org/s/libc/manual/html_node/Integer-Conversions.html#Integer-Conversions

At least there should be a way to turn off "%L" format warnings off, separately
from -Wformat. The rest of -Wformat may be useful when compiling the kernel,
just not this one (since the printf implementation is part of the kernel, and
it handles %Ld there is no point in warning about it).

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