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

fix(sysdig): fix several compilation warnings #2121

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

hhoffstaette
Copy link
Contributor

@hhoffstaette hhoffstaette commented Sep 18, 2024

This fixes some inconsistencies that gcc-14 complains about:

  • missing virtual default destructor in a base class
  • potential use of uninitialised member variable
  • mismatched type comparison (uint vs. int)

Nothing too critical, but why not. In detail:

/tmp/portage/dev-debug/sysdig-0.38.1-r1/work/sysdig-0.38.1/userspace/sinspui/cursescomponents.h:20:7: warning: 'class search_caller_interface' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]
   20 | class search_caller_interface
      |       ^~~~~~~~~~~~~~~~~~~~~~~

/tmp/portage/dev-debug/sysdig-0.38.1-r1/work/sysdig-0.38.1/userspace/sinspui/cursescomponents.h:96:7: warning: 'ci.curses_table_column_info::m_size' may be used uninitialized [-Wmaybe-uninitialized]
   96 | class curses_table_column_info
      |       ^~~~~~~~~~~~~~~~~~~~~~~~

/tmp/portage/dev-debug/sysdig-0.38.1-r1/work/sysdig-0.38.1/userspace/sinspui/cursesui.cpp:2116:46: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int32_t' {aka 'int'} [-Wsign-compare]
 2116 |                 if(sinfo->m_prev_sorting_col != m_views.at(m_selected_view)->m_sortingcol)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There is a boatload more warnings wrt. potential string buffer overflows, but those are mostly harmless because the code is kind of weird & confuses gcc; unfortunately they are not easily fixed.

This fixes some inconsistencies that gcc-14 complains about:
- mismatched type comparison (uint vs. int)
- missing virtual default destructor in a base class
- potential use of uninitialised member variable

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
@hhoffstaette
Copy link
Contributor Author

Apparently the CLA process requiring a sysdig-CLA-1.0-signed-off-by is no more, so I hope the regular S-o-b is OK.

@therealbobo therealbobo merged commit 558e797 into draios:dev Sep 19, 2024
9 checks passed
@hhoffstaette hhoffstaette deleted the sysdig-warnings branch September 19, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants