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

            Bug ID: 20356
           Summary: -pedantic turns on -Wformat-non-iso even though
                    positional arguments are part of POSIX.1 2008
           Product: clang
           Version: 3.2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Compile the following example program with -std=c99 -pedantic:

    #define _POSIX_C_SOURCE 200809L
    #include <stdio.h>

    extern int
    main(void)
    {
        printf("%2$*1$d\n", 10, 4223);
        return (0);
    }

clang will warn that positional arguments are not in ISO C. Although
technically correct, this warning is not useful as positional arguments are
part of POSIX.1 2008, compliancy with which I explicitly request using a
feature test macro. This renders the -pedantic flag much less useful to develop
(POSIX) portable applications as it generates warnings about features that are
available on conforming platforms.

It might make sense to define an extra warning flag -pedantic=posix which is
pedantic about stuff that is neither in ISO C nor POSIX.

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