comparison src/share/vm/code/compressedStream.cpp @ 17937:78bbf4d43a14

8037816: Fix for 8036122 breaks build with Xcode5/clang 8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas 8043164: Format warning in traceStream.hpp Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings Reviewed-by: kvn, coleenp, iveresov, twisti
author drchase
date Thu, 22 May 2014 15:52:41 -0400
parents 55fb97c4c58d
children 52b4284cb496
comparison
equal deleted inserted replaced
17935:7384f6a12fc1 17937:78bbf4d43a14
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
210 // move l upwards, maybe 210 // move l upwards, maybe
211 l <<= (x >> 16); 211 l <<= (x >> 16);
212 return h ^ l; 212 return h ^ l;
213 } 213 }
214 214
215 PRAGMA_DIAG_PUSH
216 PRAGMA_FORMAT_IGNORED // Someone needs to deal with this.
215 void test_compressed_stream(int trace) { 217 void test_compressed_stream(int trace) {
216 CompressedWriteStream bytes(stretch_limit * 100); 218 CompressedWriteStream bytes(stretch_limit * 100);
217 jint n; 219 jint n;
218 int step = 0, fails = 0; 220 int step = 0, fails = 0;
219 #define CHECKXY(x, y, fmt) { \ 221 #define CHECKXY(x, y, fmt) { \
273 if (trace != 0) 275 if (trace != 0)
274 tty->print_cr("finished test of %d stream values, size %d", step, length2); 276 tty->print_cr("finished test of %d stream values, size %d", step, length2);
275 guarantee(length == length2, "bad length"); 277 guarantee(length == length2, "bad length");
276 guarantee(fails == 0, "test failures"); 278 guarantee(fails == 0, "test failures");
277 } 279 }
280 PRAGMA_DIAG_POP
278 281
279 #if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64) 282 #if defined(_MSC_VER) &&_MSC_VER >=1400 && !defined(_WIN64)
280 #pragma warning(default: 4748) 283 #pragma warning(default: 4748)
281 #pragma optimize("", on) 284 #pragma optimize("", on)
282 #endif 285 #endif