Document intentional violations of header inclusion policy.
Tom Lane <tgl@sss.pgh.pa.us>
Document intentional violations of header inclusion policy. Although there are good reasons for our policy of including postgres.h as the first #include in every .c file, never from .h files, there are two places where it seems expedient to violate the policy because the alternative is to modify externally-supplied .c files. (In the case of the regexp library, the idea that it's externally-supplied is kind of at odds with reality, but I haven't entirely given up hope that it will become a standalone project some day.) Add some comments to make it explicit that this is a policy violation and provide the reasoning. In passing, move #include "miscadmin.h" out of regcomp.c and into regcustom.h, which is where it should be if we're taking this reasoning seriously at all. Discussion: https://postgr.es/m/CAEepm=2zCoeq3QxVwhS5DFeUh=yU6z81pbWMgfOB8OzyiBwxzw@mail.gmail.com Discussion: https://postgr.es/m/11634.1488932128@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/regex/regcomp.c | modified | +0 −2 |
| src/include/regex/regcustom.h | modified | +9 −0 |
| src/include/snowball/header.h | modified | +5 −0 |
Discussion
- WIP: [[Parallel] Shared] Hash 83 messages · 2016-11-01 → 2017-11-30
- Removing #include "postgres.h" from a couple of headers 5 messages · 2017-03-08