Skip to content

Commit 171da2e

Browse files
authored
avoid dependency on transitive includes - based on include-what-you-use (cppcheck-opensource#3757)
1 parent 8764110 commit 171da2e

146 files changed

Lines changed: 717 additions & 66 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cli/cmdlineparser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "check.h"
2222
#include "cppcheckexecutor.h"
23+
#include "errortypes.h"
2324
#include "filelister.h"
2425
#include "importproject.h"
2526
#include "path.h"
@@ -32,6 +33,7 @@
3233
#include "utils.h"
3334

3435
#include <algorithm>
36+
#include <climits>
3537
#include <cstdio>
3638
#include <cstdlib> // EXIT_FAILURE
3739
#include <cstring>

cli/cppcheckexecutor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "color.h"
2424
#include "config.h"
2525
#include "cppcheck.h"
26+
#include "errortypes.h"
2627
#include "filelister.h"
2728
#include "importproject.h"
2829
#include "library.h"
@@ -35,13 +36,17 @@
3536
#include "utils.h"
3637
#include "checkunusedfunctions.h"
3738

39+
#include <algorithm>
40+
#include <atomic>
3841
#include <csignal>
3942
#include <cstdio>
4043
#include <cstdlib> // EXIT_SUCCESS and EXIT_FAILURE
4144
#include <cstring>
45+
#include <functional>
4246
#include <iostream>
4347
#include <list>
4448
#include <memory>
49+
#include <type_traits>
4550
#include <utility>
4651
#include <vector>
4752

cli/cppcheckexecutor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
#define CPPCHECKEXECUTOR_H
2121

2222
#include "color.h"
23+
#include "config.h"
2324
#include "errorlogger.h"
2425

2526
#include <cstdio>
2627
#include <ctime>
28+
#include <iosfwd>
2729
#include <map>
2830
#include <set>
2931
#include <string>
32+
#include <vector>
3033

3134
class CppCheck;
3235
class Library;

cli/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,13 @@
5959
*/
6060

6161

62+
#include "errortypes.h"
6263
#include "cppcheckexecutor.h"
6364

65+
#include <cstdlib>
66+
#include <exception>
67+
#include <string>
68+
6469
#ifdef NDEBUG
6570
#include <iostream>
6671
#endif

cli/threadexecutor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "config.h"
2323
#include "cppcheck.h"
2424
#include "cppcheckexecutor.h"
25+
#include "errortypes.h"
2526
#include "importproject.h"
2627
#include "settings.h"
2728
#include "suppressions.h"
@@ -30,6 +31,7 @@
3031
#include <cerrno>
3132
#include <cstdlib>
3233
#include <cstring>
34+
#include <functional>
3335
#include <iostream>
3436
#include <utility>
3537

lib/astutils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@
3333

3434
#include <algorithm>
3535
#include <functional>
36+
#include <initializer_list>
3637
#include <iterator>
3738
#include <list>
39+
#include <map>
40+
#include <memory>
3841
#include <set>
3942
#include <stack>
43+
#include <type_traits>
44+
#include <unordered_map>
4045
#include <utility>
4146

4247
template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>

lib/bughuntingchecks.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,25 @@
1717
*/
1818

1919
#include "bughuntingchecks.h"
20+
2021
#include "astutils.h"
2122
#include "errorlogger.h"
23+
#include "errortypes.h"
24+
#include "library.h"
25+
#include "mathlib.h"
2226
#include "settings.h"
2327
#include "symboldatabase.h"
2428
#include "token.h"
29+
#include "utils.h"
30+
#include "valueflow.h"
31+
32+
#include <algorithm>
2533
#include <cstring>
34+
#include <list>
35+
#include <map>
36+
#include <memory>
37+
#include <string>
38+
#include <utility>
2639

2740
static const CWE CWE_BUFFER_UNDERRUN(786U); // Access of Memory Location Before Start of Buffer
2841
static const CWE CWE_BUFFER_OVERRUN(788U); // Access of Memory Location After End of Buffer

lib/check.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
#include "errorlogger.h"
2424
#include "settings.h"
25+
#include "token.h"
2526
#include "tokenize.h"
27+
#include "valueflow.h"
2628

2729
#include <cctype>
2830
#include <iostream>

lib/check64bit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222

2323
#include "check64bit.h"
2424

25+
#include "errortypes.h"
2526
#include "settings.h"
2627
#include "symboldatabase.h"
2728
#include "token.h"
2829
#include "tokenize.h"
2930

31+
#include <vector>
3032

3133
//---------------------------------------------------------------------------
3234

lib/checkassert.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "checkassert.h"
2424

25+
#include "errortypes.h"
2526
#include "settings.h"
2627
#include "symboldatabase.h"
2728
#include "token.h"

0 commit comments

Comments
 (0)