[LLVMbugs] [Bug 20356] New: -pedantic turns on -Wformat-non-iso even though positional arguments are part of POSIX.1 2008
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jul 18 05:48:54 PDT 2014
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: unassignedclangbugs at nondot.org
Reporter: fuzxxl at gmail.com
CC: llvmbugs at cs.uiuc.edu
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140718/935d4ee7/attachment.html>
More information about the llvm-bugs
mailing list