1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

suppress GCC's -Wsuggest-attribute=format

I was not aware of this because I use clang these days.
This commit is contained in:
卜部昌平 2021-09-09 14:05:11 +09:00
parent fd12bc1896
commit dddc618d30
Notes: git 2021-09-10 20:01:02 +09:00
6 changed files with 14 additions and 2 deletions

View file

@ -353,9 +353,9 @@ static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, const NOD
/* error */
#if CPDEBUG > 0
NORETURN(static void append_compile_error(const rb_iseq_t *iseq, int line, const char *fmt, ...));
RBIMPL_ATTR_NORETURN()
#endif
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 4)
static void
append_compile_error(const rb_iseq_t *iseq, int line, const char *fmt, ...)
{

View file

@ -108,6 +108,7 @@ err_position_0(char *buf, long len, const char *file, int line)
}
}
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 5, 0)
static VALUE
err_vcatf(VALUE str, const char *pre, const char *file, int line,
const char *fmt, va_list args)
@ -344,6 +345,7 @@ rb_write_warning_str(VALUE str)
rb_warning_warn(rb_mWarning, str);
}
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 0)
static VALUE
warn_vsprintf(rb_encoding *enc, const char *file, int line, const char *fmt, va_list args)
{
@ -396,6 +398,7 @@ rb_category_compile_warn(rb_warning_category_t category, const char *file, int l
rb_warn_category(str, rb_warning_category_to_name(category));
}
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 2, 0)
static VALUE
warning_string(rb_encoding *enc, const char *fmt, va_list args)
{
@ -716,6 +719,7 @@ postscript_dump(FILE *out)
bug_important_message(out, msg, msglen);
}
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 2, 0)
static void
bug_report_begin_valist(FILE *out, const char *fmt, va_list args)
{
@ -779,6 +783,7 @@ die(void)
abort();
}
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 1, 0)
void
rb_bug_without_die(const char *fmt, va_list args)
{

View file

@ -38,6 +38,7 @@
#endif
#include "ruby/internal/dllexport.h"
#include "ruby/internal/attr/format.h"
#ifndef M_PI
# define M_PI 3.14159265358979323846
@ -211,6 +212,7 @@ RUBY_EXTERN int ruby_close(int);
#endif
#ifndef HAVE_SETPROCTITLE
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 1, 2)
RUBY_EXTERN void setproctitle(const char *fmt, ...);
#endif

View file

@ -43,6 +43,7 @@ extern long rb_backtrace_length_limit;
extern VALUE rb_eEAGAIN;
extern VALUE rb_eEWOULDBLOCK;
extern VALUE rb_eEINPROGRESS;
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 0)
void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args);
NORETURN(void rb_async_bug_errno(const char *,int));
const char *rb_builtin_type_name(int t);
@ -114,6 +115,7 @@ void rb_deprecated_method_to_be_removed(const char *);
# define RBIMPL_TODO0(x)
#endif
#define RBIMPL_TODO(message) RBIMPL_TODO0("TODO: " message)
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 6, 0)
VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
@ -124,6 +126,7 @@ VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv);
VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name);
PRINTF_ARGS(VALUE rb_warning_string(const char *fmt, ...), 1, 2);
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 2, 0)
NORETURN(void rb_vraise(VALUE, const char *, va_list));
NORETURN(static inline void rb_raise_cstr(VALUE etype, const char *mesg));
NORETURN(static inline void rb_raise_cstr_i(VALUE etype, VALUE mesg));

View file

@ -1661,6 +1661,7 @@ extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const
#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp))
void rb_vm_bugreport(const void *);
typedef void (*ruby_sighandler_t)(int);
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5)
NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...));
/* functions about thread/vm execution */

View file

@ -87,6 +87,7 @@ extern enum ruby_debug_log_mode {
ruby_debug_log_file = 0x04,
} ruby_debug_log_mode;
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5)
void ruby_debug_log(const char *file, int line, const char *func_name, const char *fmt, ...);
void ruby_debug_log_print(unsigned int n);
bool ruby_debug_log_filter(const char *func_name);