glr.cc: disable warnings from Clang on macOS

$ cat test.cc
    #include <stddef.h>
    #include <stdint.h>

    ptrdiff_t half_max_capacity = PTRDIFF_MAX;
    $ clang++-mp-9.0 -pedantic -std=c++98 /tmp/test.cc -c
    /tmp/test.cc:4:31: warning: 'long long' is a C++11 extension [-Wc++11-long-long]
    ptrdiff_t half_max_capacity = PTRDIFF_MAX;
                                  ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h:149:23:
            note: expanded from macro 'PTRDIFF_MAX'
    #define PTRDIFF_MAX       INT64_MAX
                              ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdint.h:75:26:
            note: expanded from macro 'INT64_MAX'
    #define INT64_MAX        9223372036854775807LL
                             ^
    1 warning generated.

* data/skeletons/glr.cc: here.
This commit is contained in:
Akim Demaille
2019-12-08 16:34:53 +01:00
parent 80f3220fea
commit b3abe014f2

View File

@@ -265,6 +265,12 @@ b4_percent_code_get([[requires]])[
# pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
// 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"
#endif
// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS
# if defined __GNUC__ && !defined __EXCEPTIONS