This is a discussion on Headers dependencies cleanup within the Pgsql Patches forums, part of the PostgreSQL category; --> During my work I found some header files, which include useless headers and on other way there are some ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| During my work I found some header files, which include useless headers and on other way there are some headers which silently assume that requested header will be included by some other headers file. This patch fixes these dependencies around bufpage.h, bufmgr.h Zdenek ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| Zdenek Kotala wrote: > During my work I found some header files, which include useless headers > and on other way there are some headers which silently assume that > requested header will be included by some other headers file. > > This patch fixes these dependencies around bufpage.h, bufmgr.h What's the point here, again? -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Alvaro Herrera <alvherre@commandprompt.com> writes: > Zdenek Kotala wrote: >> During my work I found some header files, which include useless headers >> and on other way there are some headers which silently assume that >> requested header will be included by some other headers file. >> >> This patch fixes these dependencies around bufpage.h, bufmgr.h > What's the point here, again? Bruce periodically runs a script that's supposed to catch this type of problem. Maybe we are overdue for another run? regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Alvaro Herrera napsal(a): > Zdenek Kotala wrote: >> During my work I found some header files, which include useless headers >> and on other way there are some headers which silently assume that >> requested header will be included by some other headers file. >> >> This patch fixes these dependencies around bufpage.h, bufmgr.h > > What's the point here, again? > Main point there is bufpage.h I have needed include this header in page layout convector but it include bufmgr.h which is useless there and generates a lot of another dependences (e.g. on fmgr.h). Other changes are related to this change. Zdenek -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Tom Lane napsal(a): > Alvaro Herrera <alvherre@commandprompt.com> writes: >> Zdenek Kotala wrote: >>> During my work I found some header files, which include useless headers >>> and on other way there are some headers which silently assume that >>> requested header will be included by some other headers file. >>> >>> This patch fixes these dependencies around bufpage.h, bufmgr.h > >> What's the point here, again? > > Bruce periodically runs a script that's supposed to catch this type > of problem. Maybe we are overdue for another run? > Yes, but This problem is there for long time and I think Bruce's script does not catch it. Zdenek -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes: >>> During my work I found some header files, which include useless headers >>> and on other way there are some headers which silently assume that >>> requested header will be included by some other headers file. >> >> Bruce periodically runs a script that's supposed to catch this type >> of problem. Maybe we are overdue for another run? > Yes, but This problem is there for long time and I think Bruce's script does not > catch it. Exactly what problem do you see that he didn't catch? regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Tom Lane napsal(a): > Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes: >>>> During my work I found some header files, which include useless headers >>>> and on other way there are some headers which silently assume that >>>> requested header will be included by some other headers file. >>> Bruce periodically runs a script that's supposed to catch this type >>> of problem. Maybe we are overdue for another run? > >> Yes, but This problem is there for long time and I think Bruce's script does not >> catch it. > > Exactly what problem do you see that he didn't catch? bufpage.h includes bufmgr.h, but bufpage.h does not require any definition from bufmgr.h. I think this dependency is there for long time. Zdenek -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Tom Lane wrote: > Alvaro Herrera <alvherre@commandprompt.com> writes: > > Zdenek Kotala wrote: > >> During my work I found some header files, which include useless headers > >> and on other way there are some headers which silently assume that > >> requested header will be included by some other headers file. > >> > >> This patch fixes these dependencies around bufpage.h, bufmgr.h > > > What's the point here, again? > > Bruce periodically runs a script that's supposed to catch this type > of problem. Maybe we are overdue for another run? Last run was July, 2006: revision 1.48 date: 2006/07/13 18:01:01; author: momjian; state: Exp; lines: +1 -2 More include file adjustments. ---------------------------- revision 1.47 date: 2006/07/13 17:47:01; author: momjian; state: Exp; lines: +2 -1 More include file adjustments. ---------------------------- revision 1.46 date: 2006/07/13 16:49:19; author: momjian; state: Exp; lines: +2 -1 Allow include files to compile own their own. Strip unused include files out unused include files, and add needed includes to C files. I run it every few years rather than every year because it can break stuff that we have to manually fix by adding includes. If you want it run now or every year, let me know. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| |||
| Zdenek Kotala wrote: > Tom Lane napsal(a): > > Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes: > >>>> During my work I found some header files, which include useless headers > >>>> and on other way there are some headers which silently assume that > >>>> requested header will be included by some other headers file. > >>> Bruce periodically runs a script that's supposed to catch this type > >>> of problem. Maybe we are overdue for another run? > > > >> Yes, but This problem is there for long time and I think Bruce's script does not > >> catch it. > > > > Exactly what problem do you see that he didn't catch? > > bufpage.h includes bufmgr.h, but bufpage.h does not require any definition from > bufmgr.h. I think this dependency is there for long time. My scripts should have found this issue, see src/tools/pginclude/pgrminclude. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |
| ||||
| Bruce Momjian <bruce@momjian.us> writes: > Zdenek Kotala wrote: >> bufpage.h includes bufmgr.h, but bufpage.h does not require any definition from >> bufmgr.h. I think this dependency is there for long time. > My scripts should have found this issue, see > src/tools/pginclude/pgrminclude. Looking over the file more closely, I disagree with Zdenek's claim anyway. Even though the file could physically be scanned without having included bufmgr.h first, many of the macros it defines can't be used without bufmgr.h, and so that file really is a prerequisite. If we removed the include here it would just have to pop up in calling .c files. Anyplace that that was solely because of calling one of the macros defined by bufpage.h, rather than explicitly using anything from bufmgr.h, I claim it'd be wrong. This example makes me question using scripts for this type of maintenance, though, as it's not clear that a does-it-compile test would understand macro dependencies. It's probably true that we've let the header inclusions in storage/ and access/ get a bit spaghetti-ish. But I think that if we're going to do something about it, focusing on one or two files is not the way to start. What we need is for someone to go through all those files and propose a clear layering of them. This will very likely involve having to move some declarations around, when we realize something got put in a poorly chosen place. regards, tom lane -- Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-patches |