comparison src/share/vm/classfile/classFileParser.hpp @ 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 edb5ab0f3fe5
children f73af4455d7d
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.
310 void classfile_parse_error(const char* msg, int index, const char *name, TRAPS); 310 void classfile_parse_error(const char* msg, int index, const char *name, TRAPS);
311 inline void guarantee_property(bool b, const char* msg, TRAPS) { 311 inline void guarantee_property(bool b, const char* msg, TRAPS) {
312 if (!b) { classfile_parse_error(msg, CHECK); } 312 if (!b) { classfile_parse_error(msg, CHECK); }
313 } 313 }
314 314
315 inline void assert_property(bool b, const char* msg, TRAPS) { 315 PRAGMA_DIAG_PUSH
316 PRAGMA_FORMAT_NONLITERAL_IGNORED
317 inline void assert_property(bool b, const char* msg, TRAPS) {
316 #ifdef ASSERT 318 #ifdef ASSERT
317 if (!b) { 319 if (!b) {
318 ResourceMark rm(THREAD); 320 ResourceMark rm(THREAD);
319 fatal(err_msg(msg, _class_name->as_C_string())); 321 fatal(err_msg(msg, _class_name->as_C_string()));
320 } 322 }
327 ResourceMark rm(THREAD); 329 ResourceMark rm(THREAD);
328 fatal(err_msg(msg, index, _class_name->as_C_string())); 330 fatal(err_msg(msg, index, _class_name->as_C_string()));
329 } 331 }
330 #endif 332 #endif
331 } 333 }
334 PRAGMA_DIAG_POP
332 335
333 inline void check_property(bool property, const char* msg, int index, TRAPS) { 336 inline void check_property(bool property, const char* msg, int index, TRAPS) {
334 if (_need_verify) { 337 if (_need_verify) {
335 guarantee_property(property, msg, index, CHECK); 338 guarantee_property(property, msg, index, CHECK);
336 } else { 339 } else {