|
1 | 1 | src/tools/pginclude/README |
2 | 2 |
|
3 | | -NOTE: headerscheck and headerscheck --cplusplus are in current use, |
4 | | -and any problems they find should generally get fixed. The other |
5 | | -scripts in this directory have not been used in some time, and have |
6 | | -issues. pgrminclude in particular has a history of creating more |
7 | | -problems than it fixes. Be very wary of applying their results |
8 | | -blindly. |
9 | | - |
10 | | - |
11 | | -pginclude |
12 | | -========= |
13 | | - |
14 | | -These utilities help clean up #include file usage. They should be run |
15 | | -in this order so that the include files have the proper includes before |
16 | | -the C files are tested. |
17 | | - |
18 | | -pgfixinclude change #include's to <> or "" |
19 | | - |
20 | | -pgcompinclude [-v] |
21 | | - report which #include files can not compile on their own |
22 | | - |
23 | | -pgrminclude [-v] |
24 | | - remove extra #include's |
25 | | - |
26 | | -pgcheckdefines |
27 | | - check for #ifdef tests on symbols defined in files that |
28 | | - weren't included --- this is a necessary sanity check on |
29 | | - pgrminclude |
30 | | - |
31 | | -pgdefine create macro calls for all defines in the file (used by |
32 | | - the above routines) |
33 | | - |
34 | | -It is also a good idea to sort the pg-specific include files in |
35 | | -alphabetic order. This is best done with a text editor. Typical usage |
36 | | -order would be: |
37 | | - |
38 | | - pgfixinclude |
39 | | - sort include references |
40 | | - run multiple times: |
41 | | - pgcompinclude |
42 | | - pgrminclude /src/include |
43 | | - pgrminclude / |
44 | | - pgcheckdefines |
45 | | - |
46 | | -There is a complexity when modifying /src/include. If include file 1 |
47 | | -includes file 2, and file 2 includes file 3, then when file 1 is |
48 | | -processed, it needs only file 2, not file 3. However, if later, include |
49 | | -file 2 is processed, and file 3 is not needed by file 2 and is removed, |
50 | | -file 1 might then need to include file 3. For this reason, the |
51 | | -pgcompinclude and pgrminclude /src/include steps must be run several |
52 | | -times until all includes compile cleanly. |
53 | | - |
54 | | -Also, tests should be done with configure settings of --enable-cassert |
55 | | -and EXEC_BACKEND on and off. It is also wise to test a WIN32 compile. |
56 | | - |
57 | | -Another tools that does a similar task is at: |
58 | | - |
59 | | - http://code.google.com/p/include-what-you-use/ |
60 | | - |
61 | | -An include file visualizer script is available at: |
62 | | - |
63 | | - http://archives.postgresql.org/pgsql-hackers/2011-09/msg00311.php |
64 | | - |
65 | | - |
66 | 3 | headerscheck |
67 | 4 | ============ |
68 | 5 |
|
|
0 commit comments