MantisBT - Doomseeker
View Issue Details
0003800Doomseeker[All Projects] Cleanuppublic2020-06-07 01:072020-06-07 21:23
WubTheCaptain 
 
nonetweakalways
acknowledgedopen 
1.3.1 
 
0003800: C-style arrays in C++ source files
C++11 introduced std::array<>. Doomseeker (and Wadseeker) use C-style arrays (inherited in C++98).
clang-tidy complains about C-style arrays in C++ source (with exceptions in main() and extern "C").
Let's modernize to C++11 and beyond?
$ grep -r "\[\]" src/ | wc -l
119
$ grep -r '\[.*\]' src/ | wc -l
2745
$ grep -r "std::vector" src/ | wc -l
0
$ grep -r "std::array" src/ | wc -l
0
$ grep -r 'array ' src/core | wc -l
8
$ grep -r 'vector ' src/core | wc -l
0

Side-note: I did not consider new[] or delete[] in these results, which are expected from C++.
'https://clang.llvm.org/extra/clang-tidy/checks/modernize-avoid-c-arrays.html [^]'
'https://en.cppreference.com/w/cpp/header/array [^]'
I couldn't find a reference in C++ standards (drafts) that C-style arrays would be deprecated syntax (unlike some other deprecated features inherited by the C++ language from the C language).
No tags attached.
child of 0003803confirmed  C++11 support 
Issue History
2020-06-07 01:07WubTheCaptainNew Issue
2020-06-07 01:07WubTheCaptainDescription Updatedbug_revision_view_page.php?rev_id=13105#r13105
2020-06-07 01:08WubTheCaptainNote Added: 0021357
2020-06-07 02:29WubTheCaptainRelationship addedchild of 0003803
2020-06-07 04:12WubTheCaptainNote Added: 0021363
2020-06-07 20:02Pol MNote Added: 0021381
2020-06-07 21:23Pol MNote Added: 0021394
2020-06-07 21:23Pol MStatusnew => acknowledged

Notes
(0021357)
WubTheCaptain   
2020-06-07 01:08   
and std::vector<>
(0021363)
WubTheCaptain   
2020-06-07 04:12   
may need to be checked after for'https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html [^]'
(0021381)
Pol M   
2020-06-07 20:02   
I could not find a Qt counterpart to std::array. Also, C arrays are not bad by itself, so I'm not too sure about pulling the trigger on this one.
(0021394)
Pol M   
2020-06-07 21:23   
From what I see it seems to be common practice, so I'll give my support :)