hotspot/src/share/vm/utilities/debug.cpp
changeset 24424 2658d7834c6e
parent 18683 a6418e038255
child 24826 ad80eed312fc
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     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.
    86 #  if -defined _DEBUG || -defined ASSERT
    86 #  if -defined _DEBUG || -defined ASSERT
    87      configuration error: ASSERT et al. must not be defined in PRODUCT version
    87      configuration error: ASSERT et al. must not be defined in PRODUCT version
    88 #  endif
    88 #  endif
    89 #endif // PRODUCT
    89 #endif // PRODUCT
    90 
    90 
       
    91 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
       
    92 
    91 FormatBufferResource::FormatBufferResource(const char * format, ...)
    93 FormatBufferResource::FormatBufferResource(const char * format, ...)
    92   : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) {
    94   : FormatBufferBase((char*)resource_allocate_bytes(RES_BUFSZ)) {
    93   va_list argp;
    95   va_list argp;
    94   va_start(argp, format);
    96   va_start(argp, format);
    95   jio_vsnprintf(_buf, RES_BUFSZ, format, argp);
    97   jio_vsnprintf(_buf, RES_BUFSZ, format, argp);
    96   va_end(argp);
    98   va_end(argp);
    97 }
    99 }
    98 
   100 
       
   101 ATTRIBUTE_PRINTF(1, 2)
    99 void warning(const char* format, ...) {
   102 void warning(const char* format, ...) {
   100   if (PrintWarnings) {
   103   if (PrintWarnings) {
   101     FILE* const err = defaultStream::error_stream();
   104     FILE* const err = defaultStream::error_stream();
   102     jio_fprintf(err, "%s warning: ", VM_Version::vm_name());
   105     jio_fprintf(err, "%s warning: ", VM_Version::vm_name());
   103     va_list ap;
   106     va_list ap;