diff options
| author | HASUMI Hitoshi <hasumikin@gmail.com> | 2024-03-15 22:14:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-15 22:14:57 +0900 |
| commit | 40ecad0ad796f1515c654c127ae498854c9a6120 (patch) | |
| tree | 2e090831fc631d4b76a6721f0ff2d657cc9e1349 /test/ruby/test_method_cache.rb | |
| parent | 1d91a1ad2db353aad37894a3e4a3756d5dd51413 (diff) | |
[Universal parser] Fix -Wsuggest-attribute=format warnings
Under a configuration including `cppflags=-DUNIVERSAL_PARSER`, warnings listed below show in build time:
```
node.c:396:30: warning: initialization left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format]
396 | bug_report_func rb_bug = ast->node_buffer->config->bug;
| ^~~
```
```
ruby_parser.c:655:21: warning: initialization left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format]
655 | .compile_warn = rb_compile_warn,
| ^~~~~~~~~~~~~~~
ruby_parser.c:656:24: warning: initialization left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format]
656 | .compile_warning = rb_compile_warning,
| ^~~~~~~~~~~~~~~~~~
ruby_parser.c:657:12: warning: initialization left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format]
657 | .bug = rb_bug,
| ^~~~~~
ruby_parser.c:658:14: warning: initialization left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format]
658 | .fatal = rb_fatal,
| ^~~~~~~~
```
To fix, this patch suggests adding `__attribute__((format(printf, n, m)))` to those function declarations.
Diffstat (limited to 'test/ruby/test_method_cache.rb')
0 files changed, 0 insertions, 0 deletions
