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

            Bug ID: 19559
           Summary: Clang issues incorrect warning when leading [^]
                    scanset is used in scanf()
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

In a C program, the following code:

char foo[1024];
scanf("%[^]% ]", foo);

Causes the following warning:

warning: invalid conversion specifier ' ' [-Wformat-invalid-specifier]

This does not happen with the format string "%[]% ]", indicating that Clang
does not recognize that a closing bracket after the caret does not close the
scanset.

Relevant C99 section is 7.19.6.2p12: “If the conversion specifier begins with
[] or [^], the right bracket character is in the scanlist and the next
following right bracket character is the matching right bracket that ends the
specification; otherwise the first following right bracket character is the one
that ends the specification."

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to