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

backport: fix warnings #1679

Open
Tracked by #1661
hustjieke opened this issue May 6, 2023 · 3 comments
Open
Tracked by #1661

backport: fix warnings #1679

hustjieke opened this issue May 6, 2023 · 3 comments
Assignees
Labels
A-feature feature with good idea A-porting back port code from 5.7/8.0 C-stonedb-8.0 associated with stonedb 8.0

Comments

@hustjieke
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

commit id: 00dac96

check this pr and keep consistent with 8.0.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@hustjieke hustjieke added A-feature feature with good idea C-stonedb-8.0 associated with stonedb 8.0 A-porting back port code from 5.7/8.0 labels May 6, 2023
@hustjieke hustjieke added this to the StoneDB_8.0_v1.0.2 milestone May 6, 2023
@hustjieke hustjieke moved this to In Progress in StoneDB for MySQL 8.0 May 6, 2023
@hustjieke hustjieke moved this from In Progress to Todo in StoneDB for MySQL 8.0 May 6, 2023
@chenshengjiang
Copy link
Collaborator

assigned me!

@chenshengjiang chenshengjiang self-assigned this May 10, 2023
@chenshengjiang chenshengjiang moved this from Todo to In Progress in StoneDB for MySQL 8.0 May 10, 2023
chenshengjiang pushed a commit to chenshengjiang/stonedb that referenced this issue May 11, 2023
@chenshengjiang
Copy link
Collaborator

chenshengjiang commented May 11, 2023

There are just 2 warnings when building stonedb8.0, and same kind
use static_cast to transform the type of rcTables.size() from long unsigned int to int

/home/stonedb/storage/tianmu/core/parameterized_filter.cpp: In member function ‘void Tianmu::core::ParameterizedFilter::UpdateMultiIndex(bool, int64_t)’:
/home/stonedb/storage/tianmu/core/parameterized_filter.cpp:1024:41: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<Tianmu::core::JustATable*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
 1024 |     for (int tableIndex = 0; tableIndex < rcTables.size(); ++tableIndex) {
      |                              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/stonedb/storage/tianmu/core/parameterized_filter.cpp: In member function ‘void Tianmu::core::ParameterizedFilter::FilterDeletedForSelectAll()’:
/home/stonedb/storage/tianmu/core/parameterized_filter.cpp:1562:41: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<Tianmu::core::JustATable*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
 1562 |     for (int tableIndex = 0; tableIndex < rcTables.size(); ++tableIndex) {
      |                              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~

mergify bot pushed a commit that referenced this issue May 16, 2023
@chenshengjiang
Copy link
Collaborator

There are 3 warnings when build type is release, above is debug type

/home/stonedb/storage/tianmu/core/column_share.cpp: In member function ‘int Tianmu::core::ColumnShare::alloc_dpn(Tianmu::common::TX_ID, const Tianmu::core::DPN*)’:
/home/stonedb/storage/tianmu/core/column_share.cpp:239:12: warning: ignoring return value of ‘int ftruncate(int, __off64_t)’, declared with attribute warn_unused_result [-Wunused-result]
  239 |   ftruncate(dn_fd, capacity * sizeof(DPN));
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/stonedb/storage/tianmu/system/channel.cpp: In member function ‘Tianmu::system::Channel& Tianmu::system::Channel::lock(uint)’:
/home/stonedb/storage/tianmu/system/channel.cpp:51:50: warning: ‘%02d’ directive writing between 2 and 11 bytes into a region of size between 0 and 17 [-Wformat-overflow=]
   51 |     std::sprintf(sdatetime, "[%4d-%02d-%02d %02d:%02d:%02d.%06d]", cdt->tm_year + 1900, cdt->tm_mon + 1, cdt->tm_mday,
      |                                                  ^~~~
/home/stonedb/storage/tianmu/system/channel.cpp:51:29: note: using the range [-2147483648, 2147483647] for directive argument
   51 |     std::sprintf(sdatetime, "[%4d-%02d-%02d %02d:%02d:%02d.%06d]", cdt->tm_year + 1900, cdt->tm_mon + 1, cdt->tm_mday,
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/mutex:38,
                 from /home/stonedb/storage/tianmu/system/channel.cpp:20:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 29 and 86 bytes into a destination of size 32
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/stonedb/storage/tianmu/types/rc_num.cpp: In member function ‘virtual Tianmu::types::BString Tianmu::types::RCNum::ToBString() const’:
/home/stonedb/storage/tianmu/types/rc_num.cpp:249:11: warning: ignoring return value of ‘char* gcvt(double, int, char*)’, declared with attribute warn_unused_result [-Wunused-result]
  249 |       gcvt(*reinterpret_cast<double *>(const_cast<int64_t *>(&value_)), 15, buf);
      |       ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-feature feature with good idea A-porting back port code from 5.7/8.0 C-stonedb-8.0 associated with stonedb 8.0
Projects
Status: In Progress
Development

No branches or pull requests

2 participants