Mercurial > hg > truffle
comparison src/share/vm/utilities/vmError.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 | f8068fa6aa46 |
children | f73af4455d7d ce8f6bb717c9 |
comparison
equal
deleted
inserted
replaced
17935:7384f6a12fc1 | 17937:78bbf4d43a14 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 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. |
39 #include "utilities/defaultStream.hpp" | 39 #include "utilities/defaultStream.hpp" |
40 #include "utilities/errorReporter.hpp" | 40 #include "utilities/errorReporter.hpp" |
41 #include "utilities/events.hpp" | 41 #include "utilities/events.hpp" |
42 #include "utilities/top.hpp" | 42 #include "utilities/top.hpp" |
43 #include "utilities/vmError.hpp" | 43 #include "utilities/vmError.hpp" |
44 | |
45 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC | |
44 | 46 |
45 // List of environment variables that should be reported in error log file. | 47 // List of environment variables that should be reported in error log file. |
46 const char *env_list[] = { | 48 const char *env_list[] = { |
47 // All platforms | 49 // All platforms |
48 "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", | 50 "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", |
356 if (_size) { | 358 if (_size) { |
357 st->print("# Native memory allocation "); | 359 st->print("# Native memory allocation "); |
358 st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " : | 360 st->print((_id == (int)OOM_MALLOC_ERROR) ? "(malloc) failed to allocate " : |
359 "(mmap) failed to map "); | 361 "(mmap) failed to map "); |
360 jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); | 362 jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); |
361 st->print(buf); | 363 st->print("%s", buf); |
362 st->print(" bytes"); | 364 st->print(" bytes"); |
363 if (_message != NULL) { | 365 if (_message != NULL) { |
364 st->print(" for "); | 366 st->print(" for "); |
365 st->print(_message); | 367 st->print("%s", _message); |
366 } | 368 } |
367 st->cr(); | 369 st->cr(); |
368 } else { | 370 } else { |
369 if (_message != NULL) | 371 if (_message != NULL) |
370 st->print("# "); | 372 st->print("# "); |
371 st->print_cr(_message); | 373 st->print_cr("%s", _message); |
372 } | 374 } |
373 // In error file give some solutions | 375 // In error file give some solutions |
374 if (_verbose) { | 376 if (_verbose) { |
375 st->print_cr("# Possible reasons:"); | 377 st->print_cr("# Possible reasons:"); |
376 st->print_cr("# The system is out of physical RAM or swap space"); | 378 st->print_cr("# The system is out of physical RAM or swap space"); |
483 if (coredump_status) { | 485 if (coredump_status) { |
484 st->print("Core dump written. Default location: %s", coredump_message); | 486 st->print("Core dump written. Default location: %s", coredump_message); |
485 } else { | 487 } else { |
486 st->print("Failed to write core dump. %s", coredump_message); | 488 st->print("Failed to write core dump. %s", coredump_message); |
487 } | 489 } |
488 st->print_cr(""); | 490 st->cr(); |
489 st->print_cr("#"); | 491 st->print_cr("#"); |
490 | 492 |
491 STEP(65, "(printing bug submit message)") | 493 STEP(65, "(printing bug submit message)") |
492 | 494 |
493 if (should_report_bug(_id) && _verbose) { | 495 if (should_report_bug(_id) && _verbose) { |