-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
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
Milestone
Comments
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
63 tasks
assigned me! |
chenshengjiang
pushed a commit
to chenshengjiang/stonedb
that referenced
this issue
May 11, 2023
14 tasks
There are just 2 warnings when building stonedb8.0, and same kind
|
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);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
chenshengjiang
pushed a commit
to chenshengjiang/stonedb
that referenced
this issue
May 18, 2023
14 tasks
hustjieke
pushed a commit
that referenced
this issue
May 21, 2023
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
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
The text was updated successfully, but these errors were encountered: