Hi Erik,

The problem is that the compiler doesn’t issue a warning in this case, but 
rather a type-mismatch error on NSEventMask, so I can’t turn it off. NSUInteger 
was being used as an enum, so Apple changed to using a real enum in 10.12 as a 
matter of code hygiene. The new code in NSApplicationAWT.m is doing the right 
thing by checking MAC_OS_X_VERSION_MAX_ALLOWED.

What particular problem were you trying to solve? Production, QA and JPRT 
builds and test runs are done on the oldest supported OSX version, so any use 
of newer features should be detected very early in the test process. 
Restricting builds to old OSX versions means that engineers who keep their 
development boxes up to date (which they should: security, etc.) can’t use them 
to do JDK development.

Thanks,

Paul

On 7/10/17, 1:10 AM, "Erik Joelsson" <erik.joels...@oracle.com> wrote:

    Hello,
    
    I do not agree to removing that macro. I added those options to help 
    guarantee that a build made on a newer version of macosx would still run 
    on the oldest version currently supported. The macro is not mainly meant 
    to be used in our code, but is picked up by system headers to cause an 
    error if any features newer than 10.7 are used. It may be that we should 
    bump it to a newer version of macosx in JDK 10, but certainly not to 10.12.
    
    It seems to me that we instead need to ignore the particular warning for 
    this case.
    
    /Erik
    
    
    On 2017-07-09 15:26, Hohensee, Paul wrote:
    > Please review the following change to get JDK10 to build on OSX 10.12 and 
above.
    >
    > https://bugs.openjdk.java.net/browse/JDK-8184022
    > http://cr.openjdk.java.net/~phh/8184022/webrev.00/
    >
    > I’d very much appreciate a sponsor for this fix. Imo, successful JDK10 
builds on all supported platforms would be sufficient testing, but please let 
me know what I can do to help.
    >
    > Slightly revised from the RFE:
    >
    > JDK-8182299<https://bugs.openjdk.java.net/browse/JDK-8182299> enabled 
previously disabled clang warnings and was intended to also enable builds on 
OSX 10 + Xcode 8. Due to a mixup, this code in 
jdk/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m
    >
    >    #if defined(MAC_OS_X_VERSION_10_12) && \
    >       MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 && \
    >       __LP64__
    >       / 10.12 changed `mask` to NSEventMask (unsigned long long) for 
x86_64 builds.
    >    - (NSEvent *)nextEventMatchingMask:(NSEventMask)mask
    >    #else
    >    - (NSEvent *)nextEventMatchingMask:(NSUInteger)mask
    >    #endif
    >    untilDate:(NSDate *)expiration inMode:(NSString *)mode 
dequeue:(BOOL)deqFlag {
    >
    > works fine with OSX versions earlier than 10.12, but fails to compile 
starting with OSX 10.12 due to MAC_OSX_VERSION_MAX_ALLOWED being defined on the 
compile command line as 10.7.
    >
    > The fix is to remove that definition, since it places an artificial upper 
bound on the OSX version under which JDK10 can be built. A source code search 
reveals no uses of MAC_OSX_VERSION_MAX_ALLOWED other than in NSApplicationAWT.m 
and hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp. The latter won't be affected 
by this change, since it checks for a version > 10.5, which is always true in 
JDK10.
    >
    > Thanks,
    >
    > Paul
    >
    
    

Reply via email to