summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/cc1_main.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-10-15 01:59:52 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-10-15 01:59:52 +0000
commit49db68d59b34351907f7f45d822919af099ed291 (patch)
tree84819313b20312a98dee1060a4dddf75bf42d7f1 /clang/tools/driver/cc1_main.cpp
parentf9b8e8b117bd9c8c989034027aca63a6e9b871f6 (diff)
downloadbcm5719-llvm-49db68d59b34351907f7f45d822919af099ed291.tar.gz
bcm5719-llvm-49db68d59b34351907f7f45d822919af099ed291.zip
Disable a silly GCC diagnostic for combining a scanf length specifier with the
'*' specifier. Apparently the GNU folks want to discourage self-documenting code. llvm-svn: 284300
Diffstat (limited to 'clang/tools/driver/cc1_main.cpp')
-rw-r--r--clang/tools/driver/cc1_main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/tools/driver/cc1_main.cpp b/clang/tools/driver/cc1_main.cpp
index 0d54278ee80..1a16746d589 100644
--- a/clang/tools/driver/cc1_main.cpp
+++ b/clang/tools/driver/cc1_main.cpp
@@ -90,12 +90,22 @@ static size_t getCurrentStackAllocation() {
// program name) after the environment, but this is close enough (we only
// need to be within 100K or so).
unsigned long StackPtr, EnvEnd;
+ // Disable silly GCC -Wformat warning that complains about length
+ // modifiers on ignored format specifiers. We want to retain these
+ // for documentation purposes even though they have no effect.
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#endif
if (fscanf(StatFile,
"%*d %*s %*c %*d %*d %*d %*d %*d %*u %*lu %*lu %*lu %*lu %*lu "
"%*lu %*ld %*ld %*ld %*ld %*ld %*ld %*llu %*lu %*ld %*lu %*lu "
"%*lu %*lu %lu %*lu %*lu %*lu %*lu %*lu %*llu %*lu %*lu %*d %*d "
"%*u %*u %*llu %*lu %*ld %*lu %*lu %*lu %*lu %*lu %*lu %lu %*d",
&StackPtr, &EnvEnd) == 2) {
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
Usage = StackPtr < EnvEnd ? EnvEnd - StackPtr : StackPtr - EnvEnd;
}
fclose(StatFile);
OpenPOWER on IntegriCloud