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

feat(stonedb): Fix up the compiling warnings. #547

Closed
andyli029 opened this issue Sep 22, 2022 · 8 comments
Closed

feat(stonedb): Fix up the compiling warnings. #547

andyli029 opened this issue Sep 22, 2022 · 8 comments
Assignees
Labels
A-feature feature with good idea C-stonedb-8.0 associated with stonedb 8.0 prio: low Low priority

Comments

@andyli029
Copy link
Contributor

andyli029 commented Sep 22, 2022

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

Due to using the GCC 10+ , a lot of compiling warnings are generated. According to the clean code rules, we should fix up these compiling warnings.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@andyli029 andyli029 added A-feature feature with good idea prio: low Low priority C-stonedb-8.0 associated with stonedb 8.0 labels Sep 22, 2022
@RingsC RingsC changed the title StoneDB 8.0: decrease too many warnings StoneDB 8.0: Remove the compiling warnings. Sep 24, 2022
@RingsC RingsC changed the title StoneDB 8.0: Remove the compiling warnings. StoneDB 8.0: Fix up the compiling warnings. Sep 24, 2022
@RingsC RingsC changed the title StoneDB 8.0: Fix up the compiling warnings. feat(stonedb): Fix up the compiling warnings. Sep 26, 2022
@lujiashun
Copy link

ACK

1 similar comment
@DandreChen
Copy link
Collaborator

ACK

@hustjieke
Copy link
Collaborator

ack

@lujiashun
Copy link

warning statistic

Wcast-qual: 147
Wunused-parameter: 16 
Wdeprecated-copy: 13
Wclass-memaccess: 3 
Wpessimizing-move: 3 
Wsuggest-override: 2 
Woverloaded-virtual: 2  
Wredundant-move: 2 
Wformat-truncation: 1  
Wignored-qualifiers: 1 
Wsuggest-attribute: 1   
Wswitch: 1  
Wundef:  1  
Wunused-but-set-variable: 1 
Wunused-result: 1 

lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 6, 2022
…tom#547)

[summary]
1 fix up about 140 'cast-qual' warnings;
mergify bot pushed a commit that referenced this issue Oct 6, 2022
[summary]
1 fix up about 140 'cast-qual' warnings;
@lujiashun
Copy link

/data/codebase/stonedb80/stonedb/storage/tianmu/async_tests/main.cc:166:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
/data/codebase/stonedb80/stonedb/storage/tianmu/async_tests/main.cc:166:27: warning: unused parameter ‘argv’ [-Wunused-parameter]
/data/codebase/stonedb80/stonedb/storage/tianmu/async_tests/task_executor.h:69:25: warning: moving a local object in a return statement prevents copy elsion [-Wpessimizing-move]
/data/codebase/stonedb80/stonedb/storage/tianmu/base/core/iostream_impl.h:38:27: warning: redundant move in return statement [-Wredundant-move]
/data/codebase/stonedb80/stonedb/storage/tianmu/base/core/sleep.h:59:23: warning: ‘virtual const char* Tianmu::base::sleep_aborted::what() const’ can bemarked override [-Wsuggest-override]
/data/codebase/stonedb80/stonedb/storage/tianmu/common/compile_opts.h:32:22: warning: "__GUNC__" is not defined, evaluates to 0 [-Wundef]
/data/codebase/stonedb80/stonedb/storage/tianmu/compress/part_dict.cpp:104:43: warning: declaration ‘class Tianmu::compress::PartDict<T>::HashTab::AKey’does not declare anything
/data/codebase/stonedb80/stonedb/storage/tianmu/core/compiled_query.cpp:400:55: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has ype ‘Tianmu::core::CompiledQuery::StepType’ [-Wformat=]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:94:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘strut Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:96:40: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘strut Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:99:50: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct Tianmu:core::DPN’ with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/engine_results.cpp:166:9: warning: variable ‘item’ set but not used [-Wunused-but-set-variable]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/item_tianmu_field.h:84:8: warning: ‘virtual bool Tianmu::core::Item_tianmufield::get_timeval(my_timval*, int*)’ can be marked override [-Wsuggest-override]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/joiner.cpp:43:32: warning: capture of variable ‘tianmu_sysvar_force_hashjoin’ with non-automatic strage duration
/data/codebase/stonedb80/stonedb/storage/tianmu/core/joiner_mapped.cpp:212:19: warning: redundant move in return statement [-Wredundant-move]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/mysql_expression.cpp:386:10: warning: enumeration value ‘INVALID_RESULT’ not handled in switch [-Wsitch]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/proxy_hash_joiner.cpp:130:21: warning: moving a local object in a return statement prevents copy elsion [-Wpessimizing-move]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/task_executor.h:69:25: warning: moving a local object in a return statement prevents copy elision [Wpessimizing-move]
/data/codebase/stonedb80/stonedb/storage/tianmu/exporter/export2file.h:32:7: warning:   by ‘int Tianmu::exporter::select_tianmu_export::prepare(List<Ite>&, Query_expression*)’ [-Woverloaded-virtual]
/data/codebase/stonedb80/stonedb/storage/tianmu/exporter/export2file.h:37:8: warning:   by ‘bool Tianmu::exporter::select_tianmu_export::send_data(THD*,mem_root_deque<Item*>&)’ [-Woverloaded-virtual]
/data/codebase/stonedb80/stonedb/storage/tianmu/handler/ha_rcengine.cpp:220:74: warning: ‘%s’ directive output may be truncated writing up to 511 bytes nto a region of size 502 [-Wformat-truncation=]
/data/codebase/stonedb80/stonedb/storage/tianmu/mm/tcm/tccommon.cpp:127:62: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
/data/codebase/stonedb80/stonedb/storage/tianmu/util/log_ctl.cpp:63:66: warning: function ‘static void Tianmu::utils::LogCtl::LogMsg(Tianmu::logger::Logtl_Level, const char*, int, const char*, ...)’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
/data/codebase/stonedb80/stonedb/storage/tianmu/vc/subselect_column.cpp:107:18: warning: ignoring return value of ‘bool std::map<_Key, _Tp, _Compare, _Aloc>::empty() const [with _Key = Tianmu::core::VarID; _Tp = Tianmu::core::DataType; _Compare = std::less<Tianmu::core::VarID>; _Alloc = std::allocator<sd::pair<const Tianmu::core::VarID, Tianmu::core::DataType> >]’, declared with attribute nodiscard [-Wunused-result]

@lujiashun
Copy link

/data/codebase/stonedb80/stonedb/storage/tianmu/compress/part_dict.cpp:104:43: warning: declaration ‘class Tianmu::compress::PartDict<T>::HashTab::AKey’ does not declare anything
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:94:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:96:40: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:99:50: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/exporter/export2file.h:32:7: warning:   by ‘int Tianmu::exporter::select_tianmu_export::prepare(List<Item>&, Query_expression*)’ [-Woverloaded-virtual]
/data/codebase/stonedb80/stonedb/storage/tianmu/util/log_ctl.h:49:112: warning: format not a string literal and no format arguments [-Wformat-security]

lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 8, 2022
…ect_tianmu_export::prepare. (stoneatom#547)

[summary]
1 prepare function is a virtual function of its base class, should override it but overload it;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 8, 2022
…ct_tianmu_export::prepare. (stoneatom#547)

[summary]
1 prepare function is a virtual function of its base class, should override it but overload it;
@lujiashun
Copy link

/data/codebase/stonedb80/stonedb/storage/tianmu/compress/part_dict.cpp:104:43: warning: declaration ‘class Tianmu::compress::PartDict<T>::HashTab::AKey’ does not declare anything
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:94:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:96:40: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:99:50: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/util/log_ctl.h:50:112: warning: format not a string literal and no format arguments [-Wformat-security]

lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 8, 2022
…ct_tianmu_export::prepare. (stoneatom#547)

[summary]
1 prepare function is a virtual function of its base class, should override it but overload it;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 8, 2022
[summary]
1 fix "warning: declaration ‘class Tianmu::compress::PartDict<T>::HashTab::AKey’ does not declare anything";
2 fix "log_ctl.h:49:112: warning: format not a string literal and no format arguments [-Wformat-security]";
@lujiashun
Copy link

/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:94:60: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:96:40: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
/data/codebase/stonedb80/stonedb/storage/tianmu/core/dpn.h:99:50: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct Tianmu::core::DPN’ with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]

lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 8, 2022
…toneatom#547)

[summary]
1 fix "warning: declaration ‘class Tianmu::compress::PartDict::HashTab::AKey’ does not declare anything";
2 fix "log_ctl.h:49:112: warning: format not a string literal and no format arguments [-Wformat-security]";
3 fix class-memaccess warning;
mergify bot pushed a commit that referenced this issue Oct 8, 2022
…ct_tianmu_export::prepare. (#547)

[summary]
1 prepare function is a virtual function of its base class, should override it but overload it;
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Oct 9, 2022
…toneatom#547)

[summary]
1 fix "warning: declaration ‘class Tianmu::compress::PartDict::HashTab::AKey’ does not declare anything";
2 fix "log_ctl.h:49:112: warning: format not a string literal and no format arguments [-Wformat-security]";
3 fix class-memaccess warning;
mergify bot pushed a commit that referenced this issue Oct 9, 2022
…547)

[summary]
1 fix "warning: declaration ‘class Tianmu::compress::PartDict::HashTab::AKey’ does not declare anything";
2 fix "log_ctl.h:49:112: warning: format not a string literal and no format arguments [-Wformat-security]";
3 fix class-memaccess warning;
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 C-stonedb-8.0 associated with stonedb 8.0 prio: low Low priority
Projects
None yet
Development

No branches or pull requests

5 participants