[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] disable warnings from Clang on macOS

From: Akim Demaille
Subject: disable warnings from Clang on macOS
Date: Sun, 8 Dec 2019 17:01:14 +0100

Hi Paul,

You might want to have a quick look at this one, in case you'd think I'm not 
strict enough on the conditions to install this pragma.  Cheers!

commit b3abe014f24b26538464f0e5aabfa9b1e94fcd60
Author: Akim Demaille <address@hidden>
Date:   Sun Dec 8 16:34:53 2019 +0100 disable warnings from Clang on macOS
        $ cat
        #include <stddef.h>
        #include <stdint.h>
        ptrdiff_t half_max_capacity = PTRDIFF_MAX;
        $ clang++-mp-9.0 -pedantic -std=c++98 /tmp/ -c
        /tmp/ warning: 'long long' is a C++11 extension 
        ptrdiff_t half_max_capacity = PTRDIFF_MAX;
                note: expanded from macro 'PTRDIFF_MAX'
        #define PTRDIFF_MAX       INT64_MAX
                note: expanded from macro 'INT64_MAX'
        #define INT64_MAX        9223372036854775807LL
        1 warning generated.
    * data/skeletons/ here.

diff --git a/data/skeletons/ b/data/skeletons/
index ceb825a9..343b52ef 100644
--- a/data/skeletons/
+++ b/data/skeletons/
@@ -265,6 +265,12 @@ b4_percent_code_get([[requires]])[
 # pragma GCC diagnostic ignored "-Wold-style-cast"
+// On MacOS, PTRDIFF_MAX is defined as long long, which Clang's
+// -pedantic reports as being a C++11 extension.
+#if defined __APPLE__ && YY_CPLUSPLUS < 201103L && 4 <= __clang_major__
+# pragma clang diagnostic ignored "-Wc++11-long-long"
 // Whether we are compiled with exception support.
 # if defined __GNUC__ && !defined __EXCEPTIONS

reply via email to

[Prev in Thread] Current Thread [Next in Thread]