Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processor_attributes: fix warnings #8451

Closed

Conversation

nokute78
Copy link
Collaborator

@nokute78 nokute78 commented Feb 3, 2024

This patch is to fix following warnings.

 [ 57%] Building C object plugins/processor_attributes/CMakeFiles/flb-plugin-processor_attributes.dir/attributes.c.o
/home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c: In function ‘attribute_match_cb’:
/home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c:829:43: warning: passing argument 2 of ‘span_contains_attribute’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  829 |         if (span_contains_attribute(span, name) == FLB_TRUE) {
      |                                           ^~~~
/home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c:676:42: note: expected ‘char *’ but argument is of type ‘const char *’
  676 |                                    char *name)
      |                                    ~~~~~~^~~~
/home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c:830:41: warning: passing argument 2 of ‘span_remove_attribute’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  830 |             span_remove_attribute(span, name);
      |                                         ^~~~
/home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c:686:40: note: expected ‘char *’ but argument is of type ‘const char *’
  686 |                                  char *name)
      |                                  ~~~~~~^~~~
/home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c:833:45: warning: passing argument 2 of ‘ctr_span_set_attribute_string’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  833 |         ctr_span_set_attribute_string(span, name, temporary_value);
      |                                             ^~~~
In file included from /home/taka/git/fluent-bit/lib/ctraces/include/ctraces/ctraces.h:84,
                 from /home/taka/git/fluent-bit/include/fluent-bit/flb_processor.h:29,
                 from /home/taka/git/fluent-bit/include/fluent-bit/flb_processor_plugin.h:24,
                 from /home/taka/git/fluent-bit/plugins/processor_attributes/attributes.c:25:
/home/taka/git/fluent-bit/lib/ctraces/include/ctraces/ctr_span.h:120:67: note: expected ‘char *’ but argument is of type ‘const char *’
  120 | int ctr_span_set_attribute_string(struct ctrace_span *span, char *key, char *value);
      |                                                             ~~~~~~^~~

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Signed-off-by: Takahiro Yamashita <[email protected]>
@cosmo0920
Copy link
Contributor

Hi @nokute78!
We decided to remove processor_attributes and processor_content_modifier is a successor of it. So, if you have a cycle, could you take a look the successor plugin instead?

@nokute78
Copy link
Collaborator Author

@cosmo0920 Thank you for information.
I built processor_content_modifier and there were no warnings.
So I close this PR.

@nokute78 nokute78 closed this Mar 15, 2024
@nokute78 nokute78 deleted the fix_processor_attributes_warnings branch March 15, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants