comparison src/share/vm/services/attachListener.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 a034dc5e910b
children 52b4284cb496 2545e461115b
comparison
equal deleted inserted replaced
17935:7384f6a12fc1 17937:78bbf4d43a14
1 /* 1 /*
2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2005, 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.
282 return JNI_ERR; 282 return JNI_ERR;
283 } 283 }
284 } 284 }
285 285
286 if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) { 286 if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {
287 FormatBuffer<80> err_msg(""); 287 FormatBuffer<80> err_msg("%s", "");
288 if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) { 288 if (!Arguments::verify_MaxHeapFreeRatio(err_msg, value)) {
289 out->print_cr(err_msg.buffer()); 289 out->print_cr("%s", err_msg.buffer());
290 return JNI_ERR; 290 return JNI_ERR;
291 } 291 }
292 } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) { 292 } else if (strncmp(name, "MinHeapFreeRatio", 17) == 0) {
293 FormatBuffer<80> err_msg(""); 293 FormatBuffer<80> err_msg("%s", "");
294 if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) { 294 if (!Arguments::verify_MinHeapFreeRatio(err_msg, value)) {
295 out->print_cr(err_msg.buffer()); 295 out->print_cr("%s", err_msg.buffer());
296 return JNI_ERR; 296 return JNI_ERR;
297 } 297 }
298 } 298 }
299 bool res = CommandLineFlags::uintxAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND); 299 bool res = CommandLineFlags::uintxAtPut((char*)name, &value, Flag::ATTACH_ON_DEMAND);
300 if (! res) { 300 if (! res) {
379 return JNI_ERR; 379 return JNI_ERR;
380 } 380 }
381 Flag* f = Flag::find_flag((char*)name, strlen(name)); 381 Flag* f = Flag::find_flag((char*)name, strlen(name));
382 if (f) { 382 if (f) {
383 f->print_as_flag(out); 383 f->print_as_flag(out);
384 out->print_cr(""); 384 out->cr();
385 } else { 385 } else {
386 out->print_cr("no such flag '%s'", name); 386 out->print_cr("no such flag '%s'", name);
387 } 387 }
388 return JNI_OK; 388 return JNI_OK;
389 } 389 }