Removing useless #include's.

Started by Kyotaro HORIGUCHIalmost 8 years ago4 messages
#1Kyotaro HORIGUCHI
horiguchi.kyotaro@lab.ntt.co.jp
1 attachment(s)

Hello.

While looking some patch, just from curiosity, I checked for
redundant #include's in the source tree (except
contrib). "redundant" here means that a file is included in
another include file nearby.

I found 641 includes that is just removable with no side effect
with two exceptions.

- src/common/saslprep.c

A comment that suggests linking wchar.c was placed just above
'#include "mb/pg_wchar.h" but it is now just above "#include
"common/unicode_norm.h" but the comment seems to be used as is.

- backend/storage/lmgr/spin.c

spin.c and spin.h don't aggree on the necessity of pg_sema.h
when HAVE_SPINLOCKS is defined. I post a mail about this issue
separately.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

remove_useless_includes.patch.gzapplication/octet-streamDownload
�
D�Zremove_useless_includes.patch�=i��6v�w~�����3��} ��^�f��9d�(��R�J�%���}H���S�=c/b�U5���*���SYW����T�xz�X�5�#�
�c��
}9�
����m\������D�� ��,M]�~����D���������������s����9��[�|��;������7�D�o�v�z4����s�=,+����\(�d�u$_B
��%����.�`����{:�k��W��n�oc}��s�/c���TZ��Z7W��L[��U	a��ixa� �����3,!��H���5�U�%��������]�$��J�P�
f����.�R/�]7�`�D�]T�Y�)eJ��QF���"�6
�z��
�����w\�LV�p�~��_��3��j���\`�al{|�U������~�>����-=���G�����op
�#�p8�'�W�i\e�="�3&6�a���xO�|#������Oq���xy/��I���Uj���9�L���0��{/��"s����<�Gd�.�pKb���*u���J4�6�[$&^*���W����/�((�i�����DU`{���c��s���02HF�Fe`'+H@�fY��R�G
�(J������u\Q@"���~z�~���
�&:@�[����F�7*���m|�i����i��fc+Ce��
05���>���zOx�?�Q���`8���,TM1b(_[���W���qKN$ZZ��AS��j�����Xd��#�n� �����s��G��}�N8[G�# �g��-,>�����-�������
w��8
�s\�rX�F��"Q���	�R��a���=�a�%��K��^k�|�M�q�����J[ih6���W�nc+�In�)=��z�Y�f����<�� ��@���3�1��(QM�.'�i�����O�ziM-G��3���(�RM�-�!aT�q�� I��2gH<
� )��~�i����\�[Vl�A����{�
��#6�f�����\����v���{yF��)��1f��Q�^�z(�����9��P�A�d��%-PF���o�=	�����z���H@��d7���^>!�_�02�������G~���d����;�i�>����i�^�'����Og$ds,\�7Cf�M�`��~���ua&��i2#2�ee��RiK���i��
�M�M��wb0��J����JB/���0���H��"�$��$���L���sy����:=4g�y���U
�Om]:'r���D��A4?����.�b����S��\q\����&�������\�� �d���������98�"Q�kF�H��BQi��D����"�x���6��V�p�a���9��A�����'��O�P��_��o�P�Z��_�+ej�[��X��F�#?d)��q4�^k����W$���5U���BYA����:�����)yVB�r��OB�jZ�/����������!�b��uf�����|}
�"f�N�`�*��s�eZ���^�WeiN��0����7��7�$�L�W�HTz�������v��A�����
j6�i���	���kx�;���aj�S�����~�Ay�n���SZ�hV|���!�
Q4�`�w��N��5p��w��Q��D��`e���o��
��I��U��op�c�=��hf�
c����8���8.3;��b���v*g�zv ���_���s��GbW!�S`
1\Z��E+���O�s?����$-��������,�P~��+?��+���cP���-%��`�u�?��u$�%[:�S��jSo�N$��I}x�����&��@<+�QZy�C/����x�@B�4'U�T��aU\79�:R�
�5U����P�k���
��V��TEL��`$
�X'��C��*���#�1�f(j{��'���C�x��Y�a��e�Ff]�GcA�	�uM��iR]������,�� �d��-�mS��*�x�p)����V���C12��P�\7�`
���:1H��<�������r��R��|�g�]2A���{*8��HF��H�cY��V�d��}&GAR��[�!�c��Iq)�'����i�Y���E8$���s���M����$�w��l��~�p|7�8���4��!��n.��{���`1����#���e^�dE��E�T���s�G�{-���
G1��k���"6w�P���|�J*���^g��������^Gi����i��2��
��uJ�:U�z�S$��%�
Y.R�V�%*KT����"s�����-��i�C"��u�����ey�#s}H�II	,��f�fM�m��o��0z{�,�D�SR_X�x�'�������(8@IsiU�
I��H�A�`����q����Mc]�p�����������yFN�P����#��m��L;<B�2
jlax�Q�UcJ�U�E�90�aQRaG�0M������6T�����N,i��J�6���$�����<.�,���)Z�������C"ng��{�8�O��g<�o�9�������8` ���cj�H�������Z��JM�E���~PT������V�T�����s����y����o�!m���u�cK���l �
�w�I�KW�ovud���Z��6&g����\��<���Q'�9��,��I%	����y���u�[��E�������?�,��=8�4,#TA�u�����\�`22�
�U!�r`A$�>O2�r��N>cgH�m��Co����]@s�j�,�u�s��?3��{$/���O�`�.ZX�R?��x8��`h���)�$�
������P=b`�	��~�dE���,�3����bd{�Br��0�M�|BM���Ds}��I���R����
5�r��G�����K�8����k���������G�+�:����E�cM0��N�((�sq���T���X�v�Q]����ol������]?cM�5���M��v|��OT�a�������sV��;���6!�U�T�:��8����W.����
��X����q�������9���!�9������o�@�3B��M���}C[J��;��=e��g���(�4�$'T�9"dO����,+G)�G��9_l�
���;�Y�j�Z�IB��}_-����-<���:bYx�2�1Z�M�K��5��2`���U���jlr�%m�+u�@�rY�$�^�N6N�xc� %al�2H��c*t��������M7�1��jl�i�mc��	��M�����k�Q���z*�������SW�t(-��Z�?�hP�k�|gy���ge�A��^�)�I"m�Gd~��q��12<�a1�}�5
�i�L�����,~q����IVUg+�6of@��6���ro�l��cLZ0_�$��[�w����V�2��1�O�i%���������G�&E��z��n�Y��_��K���������+{!����������P���ZKZ��>�kl~V�Q��.
}/
��2;,f-�����v���w��r��������|���m,
>����PiS�<	�`"�0��f
�4��W��P/�"�����]�_�!L������{�;��P<Q���u�	����EI��k��W����M3�:�G������Y��8�]@��Nm��H�X��U
�����kJzT7���hNR�&fR�'��V~hrm��m��b`A����������9tjd�f��X�^��g��6Fl�-�0)Q��n��(������I[��]���Y/}�����Z��n�fA8�Ct?Ae�\�AV����5*+�q`mf�T���h�1w�22c}K=?��z=�Q���Y��Q	��}?��k�/
]7�P�c����)�fs;r:�C�
�u(s��b�,Y�;_������3�����M�!+�h-��!��YR�V����<V����34�!+~=J�U�G�����K�1���w�W��!���,��y-:/AC���(�J�q&*+*s`���M(*!��\���� Stj;y��f>+pq�T��Q�m;������~@���TR�eU�aE��^�MeU�Ed9�0����
�)
0J�����J�V���W�mo�~�+�+��f����>�������r���g!���` (����
*fl�C^7���zC����dH��~u>�*�P��,c�]�%�Z__eW��^���R�����I���x�FU���*{�D�������	
���h�}��� V)1����yhJ�*<&��@��� �����=����#�� �j�d��df��%��1�a��L��b#Y�foy�u�����*��}v�3�K=�)r��x|�cIN`�JO�,�O{�G�
{O
�,���L����JM���Q�����0��1L��*}�I�J�)��Z�<U������?�}��R�5m=UbiY��lFb�2�xG�q=���=�0��of
����<#�q�]O��������o�8|�*T5?s���?
��_��3?N���@�k��	D@�iEu���)��/�[���R��������C����'��m�8Lly�L���O��=��>X�e�d�&�5��sbS�U�vOl����O�O���5��5����O�����������i�9	����(3U��D\N�)���Opwb�s�*T=�J����H����R%�k>�:Ea*br�,��%�"Q��n���V�
��JM';y��V[Q<,f* ��������)��E� ^�	$�Qc�����|�.W��j���H��)����^	,���W�o�v���������M}<�1����E���LS���^�a]��8�b��jDZ�����rwo=�PX�Ph���T*!d�|�l:~	�%��P��^-��=GN�=dQ�1>�Rr��d�!�{;���f���o�z�\%�Bi��:����o-6Lc
.�g@�S�8��AO��#�Pq���������U1�
�G�Q���u�<��R�,5���h�HU�z�Q��g{�X������Fr0I(KZGS�d��]^'~I������U�Q�fi����a?\GX��E��CQ��{>5��T�j��1I�
�
�A	_(�<l�M0�J_���� ���y���s�{����a�P�I��������=2R�����a��<C���3�k��Y��b��s���U������6Q��x����
�u���;A���I���X-g���.�[9�kW�B�7�B)�[(�L�((EX��K�&A�����$�����~�YG���N��Ns�Q��&N@X]�v���Q�����bBO����������
^]������"W�h}Z��� %"-�nA)�r���6��ML
	K�I�8k�/S�X������l�=�Y�OC���������X�E��/����
�����Q7w���:}+%d��Z�����*V�{+���IUm�xl����@�*��9tjLzF���N�����*��q�����-v��a����yN#�$sB� �\�,b�n,���P^����/������R����R��\������0��L��AM��j�������x�������L��,s'��.o��(�`�)�����j���V���	��=���R3��B�h35!�Q���N4��cDQC]7LQ�B]RP�HB(%-Ub�������Y��@���y.�� �~y~�cfI�X^����{:R0���pz��8@��y%��e��!}�'�Z7Qw�����g:7�����\
�[��E�&X��UKP�nb�����$�����\�pPM���"}��<����3j=V��a��n@���/v�J'��&mJSlw�3�F"[%��Auvku��Q@z�ros^_*�������FT[�>�V��	U��U{����z�-���
��8f�h85+��Q��</��}��������G}�w;BI�G�e>	�0)#�E<B]6w�@�C�4��:������ ;FU��rX��"����5�I�/����~e~Y�.v5�,������l�y&��
KW��e�P6	��4[��u_�B���a��Uae����������>����P�+bX�lJ"��M�Tb�q��fJ���?�i�}���
��W$��	�,M�$��B�|��.�(�t�@_�@��-#��O�*�H�_	����$�A�I��p<����RV�4�u]JLZ:�`_�$�����!�H|����*�/�y�y&qE��
�������T������I_�&��W~s��=��'��=2u��L��4���JW����|��]r����U��c�&��@�m0�&G�1�i���;|���,�<�l){�'����O�to_}���pcO��������!x�Z���2�Dw��>+:I^��y�_P�M��i�����S�m��~�����9 ����Q�+���^Y��6i�����1��������>�m#y~�����[Y#Q|?n|��5��H�O�o�>U��]�z�X����_$H�`U����Xw�����L�����k15JlF&����s�|�.�,��a�����I{c���������[�X�*L�dB�����A����p��m��i4��{\���cg���,�^F��K��>��m���h(b�V4(O�!��2�\�9��D�0��T,��sQP��S��?maTH��p��@"|Y��qR�;+�(rIw���������������h:���)��PQ^�%��FAL�0��lF���kfc�����NX�CHC>(M����)lT��jx�,
���}������yqv��#!
����PE�t�������6�%�V�H�L�:��0f�E�.�����d2Md���Pm������l����}oJ�*��5\L�,�H�.n�umq��]����qM��4�S��PQ�S�I"�T�2.��H���|�"��A/��~���>z����rL>�&�]�z�>�&D"�Ta�Q�#a]����M�toJ��9���
������H�k'��N�nA-��%��2��K-�lPxJ��w�����sr�]>��f��5�?`�&���h�,r���i4���k���pGvF1"R�h30���������G7�m����XhW	m���� O����		{7���9���������F����,��6��=B��P����X�>e�eBjDP��eU�
���U�'���������gN�����39����%�|#��p*D��-����\�"T��6����R�b1�1�G��B���4��f����t�j��2#��7�*f��{�W�-54�O>x�:��e�Vw�f����*��}�������(����j������~h�u��N���R���kT���j���]J��5 �T���g�
|V/V����{�_}!n���m��%B�r��e�+��f�$-�3!	S�*K�Z�R��L'�`:J���V����(a�Um\C��\���������eL���:T��������_�q�,���%4����!�?�H�8���:l������nXw���m���{��������|��KfI�������xhH$�8�$Mp��A^�8t9-�E�cB&��Br�����0*�#y��}�f4��E�#�~����qim��������� i3VJU���=��Z
:A��~B
��E��~K������|Oy����qX�a_����Zd������6P5����b�K�v�*�X�4�
����i��A�|��I�@�'�UlW���v�xiz9��������W��G����������e�	���]��4����X������������" E�����j�t��aS��d���a�2	Y�*������0vVk���#�]
����k*>�,�.��VI1�5�V���y�#��T��5��������F�b��d�����
!��R2�8B8�S�G	AU�8���2�>��xT��G��/�]���w��t�����(��D�����,�����4k@���O�f+��6���c4���p�uOEbX�5bQ������= ����X�9�����#����������M����������f�XEv��p2F���B�FYI%PUIjhV�� ������������!�T������������G>��S�d|��
.���y#l��O2��(�7)aU8"E���NV�n���+���M�2�{���k��tk;�n
�:t��:�Q���-B��CQ2{��m��H���w�S���#f�ysL|�����A�i���\Ut��Q����4��n%8���.A������9��X�=�,~���b*��'T�����>[y���==U�<�wzo���m�K;���4�K��j��t�/Z54?��\���ot
��]*&eSWA�U�5,��F�y��\\�Y?�� �C�9���2�(t��Mw�G���~��m9��asf�P�����������P��^�Bzw�_������_����/^�087�����6jZ��6R��XRo7I����'���E�$J~M��+V�(C8��B�~
j=���4p�n���
/�]�Qbo��=,�	��DE"��A�@���EtSbQ{ik/��AH��0���u����Aw��I�,��F���U����T}�Q����[������w���U�OZ���l��M����J2 ��_�����g���]��U_�oTJ��_�09c����b)76��er�'L�����e�3��"���)x��L�i
��|���6�������ey�o�a ��E��*�������Y��H�����x�.���AnU�OF��1�;�M��:����� e)N=�������f�B����yjH���u{��bs�}{����{���������|:=���%j����}]'��<����h�4��7�PEtWU��%���_�"�����9�����w��q��TT��Y���5TF7T]�EY��JS�e�#i�hEM�����������}gO��WY���/"$��4$��ES���(N
c	\^wfH(X����������������"8��:
a4�AS$���&��(���a�TOAs�Yo9t���b��[].g�L�3ce�3�:�����8����W6����DO"u�Bw�!���B`[�]��7�jXG%��c�u7b�2�M�8hZO��y7�0�tH_�|���^����<�V�\��{�
��KY&����������T"#\fa��11�Bh�i��H�`���+�&g���|~��E�fO�>�;���P�2�����(��89��,2�KT�,JS���u����~���?�^�w�f]�~9PG�<��i�oO�E���,>�Y�;�b��D������I�P-v=�'+Y9���B�EH���ip��!�f0����x��'�g�L�g�HY
b�;�ww�6�[��7Y	�������$���5�1�b��@'u��I�E�s��U�/wR��t�%�����2��$`��Q�B���X�!�n'�n�+���LW�y�),@�EZ2��2�1�:�[�����J�?op�"P�m	82�\������H���&�,R�$����t�B	2Nm�����RcY��h�t������eF2��?�����)�����c�1��p�fA�3��L���0�/f�������� �#\H��.=���k*�����,a�x�?n(���vwt~��?�-���[4��,
�|\W�k�eX��
�1�H����"7�?(�����D&RYFiNM��i�zv�Yd#��7�*�8�w�R^0����S�K���F���"���I�t�TY�+�Sb�r@���v����y6������h�y��k�AP��`����*�'������_L�����\�$�S��)��_�XZ�o-O��"��Rs��|?i�2��Y����*����J�L�	��7:�0�r��u�pG�&�w�������� �X���s��&2U�^IA��'I��2��Z1��x�W�BUr�s��^���,��#������(��S�.���+(�Q4{��)�t]B���;Y���Y�!�I���J��L�V���!��
>���P�Qz�lq��R#�����L{3��a�����G�c����WGD/v%��s��J��d��jM��N��!�M����I*�O2�d��Z�����L���������^d/�u���oh���g���#�F��Y��+X�l�
,��F��������_y�~�2_��xZ5�
B��}�g��X:�����,bX��;�,`b�D��(������C�<b<\�73[�h���Q8*=�,�4&� �	�L��*����05m�_����R���9/�r����]F������J4�;���l96���v�K@y.��(M���I��ed��Ti�4}sU!5W�g~��W,_��\'eX�S����*y,�&,#�Z&>WY�S�����@����"��X��mG~�9�?� ����Q�!��t�uZ��I�,`��D�W�q�J D��KuWB��i��y[������w��_Ny�aH�s!���U��~�fV!�+�� �?����~C��{E
�����SP=��������61�����
b������i\�~Yd�J��u�dn/'�Sp�q��r�6ZK�r�z8@��k"�	)j&�8I��q5.�2�H
AcIz�2�%�v�����6�k�3y��9�t�}fBq{�E��,bI�*l��2'�K�rm��l�	9*�����H�1XL6�4��c/��f�O�0�&����� ��h�5.1~F
V��)t��A$m�l��9��i3W��>���,�&��Ow]c'\�q�MdbbM�Da�p��*�S��0.d����O�����
��T6W8�tFu�B����6X�/'8��0�}1�j���J[�"P�/����"����c���P���l�z��=�'��F5fCURT�e��eT�7�'-��3MR�O},pr�37�?=��"H=��d5���2�H������@�A?J^�~�{"n5��(�+N��^��6�9���@M3g��'"���n� �.��������� a�?j�+�\�M��.����1z�#-��X)��E������+�T��w��D��\.L��}g�/�����Y$�r���OL���f��J���Z��(�
j�*�a'�������S�Qgp~o����h�x��!��>B���Y��,�5A�]x$<@c�V������1����,���pE���=��[�Ec��[Y���i��t}����M��nQ����q�C��4�~�9p��#:��.���XltP�A�t�������,�S��'E��a�)��NTMUI��Y��%4�����3Z�ipk���C��G\�yW��RN
x3�r�d;��B�����+�E��DQ�C����p��)�"fX��H���uEX�n
P��~P+�_�B��/=�z����:}J��/���|#m�k�Jv5�(��BTpg���A�RK��E�=���A��.@�^�����{������)g2G�N�nt�&�f��+��I���*���6)�����j����X�q����iW�N��������S�
�i���m`�J8o1�M��:�q9nbyx#���5�)�Rm����K.^��7U���P�_�b8�c,�v+��`I�gQ�`IRf���G�;r�+��f��P��:~����w�D�~n�l��H����C����6�"'���D��	128 $"q>�!�+*p��a�x�	�~F8�Je�����t��_y��4�EBTi�q�H�p
�Q\�Z��jR���(!�P�/1�$U�1���wq�LwxoJ@�~�����3/���jE��L 6��,�}�B
���T�1��Ld�oy^�W/�vx���^�T"�U�����-K��+;/l�Q�?b��cl{_���GDe��%�#F��UA9�����@�ux���JD� �� (��b�K����e�x=E��7����|:���QL{�����SC���c�kkh((_�"����[}TK���������������o����?9k\g*�����^3RQ�D��T��4�Q
�F��,�3'���f}�� u	/�]����;C
G�z������H����]4��|z��F�5��~Rr��a��q}�X��x4u�����������H,��1*������N���rn�(�@ ���NN�WI#>�����-Z���v�Y	���������@�a|��}WJ"�\(7�����������\%{�v8jq���X��qN����'������}ovZd
��y��w}u?��@�(����&�2m�"������+���9�U����n���K��C��'�XE]a�#^|F8��U��?��CZ(.�Q��*Q�����b ���1o�V�v8�W�����x��dv�SE�C*E��{�D:���6s���GE�<�c��y�Jn�u[��C�������")#e��l�,N�K�rn�.��w/��>�U/�����l���/�;@>����wyKo��
:�����_^�����R7N^!`�e!��p\�y������*���x���lxc��6jk����a�{����0�,6��s{��w��_���wlZ^S����,H�6������5T�z�������Z�z��;�"a���'�O����sy|+G���wn	�IW���~�}Zc�����u��%�o8���q�����E�!���3~��E�4L"���q�Wp�/�j��H	�]g������,��}I����_�-���Z1wT�����c�6�
�����T�8 ���_�^?<��x�zO��|<R
��p��?
�y\`�.SMC):D*���:+���I���bn9�O�C^��~��aoS������qZ5�E�������SH�I�t�@�Fjx�[3y�i~�Z����+�
���i*�#=��P2T�$�eC�������s��Lu���7=�������Z����jD���oqk�v��}�^�@��3��4��~����{�j����������W�d�%�E��vC��co�U��@���?��zO��kg�����c�����[�������&H�&uL�����Ly�v�P���j�'��)�:�c�����������%i����Bq����%`&�D<V�������Mi| �k�|����;���[�Jx�M�i��YP�Hr��[�V����
��g��6��]�Bb�P]Pq_��
O��J���}?�(�cTu\�"����i9������f�?/�������jiV���#�AL[�K�iNjm����,FW���E�PT�:���%�.jQ�l��Eqv�o������@����*o%�����~�F�Z]�ZX�����Y����U	��bQAA%

�,��@L��s��:V�(�F�8��C�,�C_��jO������ B^q�-�����^up_��������%
��[��_-T���Xv���5H�����g�$�J��R�L�2N�	�w����XZ��
�U����� ������Xz��^���y�Mr� ����E���M�P&�zgZ����D�����^�������#��O���$����9
6
.S�u�z4����Y}��}-������{��'���=N������Ic����������P
�*���KLE����Z��i�vXi��>J�0����T}4���-�N6C��zV���s�+�i~��M����������H�=��[�%����/�N����LQU�����A�����g`_���!%�S
5���1TRE$���@EU�EQs������[���o��uTVP9\ZzS�.���8���>��#f��j5|l�U�	��f�SQ7@@���6J~���F�R-E�}	JWxf�#;��W��]�����������z�,�g};ow��@R�q
�#�0Ok��t�>IP�`��4l(_ ��V���D��&�p�i��]A>��s�J6���N��Q�j�����;`)'F
bM����le;9�0e�����AiB"��3�����:E����V3����?J�����?���P��f0��-�
i�$�&/wH���\D�Tg�]4��f=��\��:�����6�o���EqG:q�I���KR�q^�����+��)�����E�����H��D���~|�����W���~����'�v���'O��|����'����7!���~���s�?g�m�5���m�����0�P��i����4�����h��{��0�	���
�m<v���Ij�sai�� lIM��N�|��F��
�_�[X
3�G���f}����k�q�$��%���#��W6]��T���.�2cwx���� �.f���w#s�	����&
S*��6��V�.)���L����z��<��Vq\5l���Y#�f��,��E����.�2�[��Q�z��� �;��T�Q�&
M�������
��7Rk�RO�X�V'C�`O�}�ur�
��Z�u��dH/�mh����&�%���Lkd�>�)�zA��q]s����p�����ni��u�gQ8t>����_y2B�w{����:�Kh{��P�� k�\uTQJ���7����A�������g��=�m��f��o%5v����p$*��� X�`��((�9yXH2e/(������y�����`��n�O��:��������#������4�'g��%c�-A&
��sL�+��2e!�v
�����XE���Q6.7��nn3�u'!Q���( A"v~�$b������h�3�q����(��pV��\zw��:n�nu��#���&dPouGY����H@��K�s��]�]�i��i���H��rs���/hD�oBp��+�:Jc�]����]����0��]A�'�%����	O�����q1�	��Le �=)�S3��U{V�c�\W�iRD#�0�����e�A��
�W4+��5��iR��u�c�i�!VS�i��3� ��!�G*��@P6��D5\�_�"1������#�t��5w���maMP�%��������:�f�t�$r�P�5,����I>�Q��=��G<�
���t�q�hy��-x��A������I2g=xp��I��_���\�+!�����8�D���������^���O/��z�����@�����,���p���X.��{�����o{s�@����H}b�@�����tc�=Vt�y-�\�����O\J#�@����)6MT1����2u�2Q�(�L��������4
�
���lw\8
~�0+�)"r{ss�����L����#RA�$��~��p��a[i��X� �A'j�������9o<L����;������"���z�~������z�_�D��-��e31
�'��	
V���9D
�5�[�S�Jzw;FTcU��&�������u��]=����Vx�%w�-���7a2���W��@bUfkO�������+�5o��mj�bI�����|��%i� Sc��x�j^%���LJ�Qv�\���lV���p����T�(�)kz��8�f��_�����ga�c���PFtb"o���4m����)������,�k���I�����QV���1S�:���;���(Q�
�l�?F����J=�.��`�!�	�$�~�3x8s
�/�
C��VZ�Sq��:
J��a�8�i��z��$
���	p�G�(���
l��vQ������FY%x�p&GmG�A��0�b��}�P\1��6���Z��e��`�V������"9�|?����/l�r���}7i��I�i?j+����);"�
��xL>R[}%�>�}:l�b;I�Od�j��=�>����1s��m����W��P{�����yK����c�f�k�����A�Zb���$R�1N|�TE\` ��_E��Z:
�������C�������>�f=��9��8�6]g��n;�x&4��2��$a�(q��H��W1�gJ��`A9�#	�+�y�|�H��j���|�������<��t��7�\R��C�fSG%+�m�8Hr����W�3��������\lhH�����9M��9z6��A����D�c�Hm��WM�H����OO4����E,+PTn����&r����(K�]��9xM�@���p8�dS�`]Tz�Xdy	����?i������ 1�1��B�HPm��uZ����_�U;T���-������a����n0�;�L;O�2���q	%��������#-4�_��0.�w7�3���j��s�BeUQ�'����P�����5�,\�~���cA�=���C�O�!B�*��t���}�"�!�Dz�F
9*�������E!��j� ,�/cj�@�I]�������1�����#�mw�D#�i�I�@WI���u�W�1~���q��>~�,�	[e��3�=�<Dx��	E��A�&�-R�t��bpY�q���HA�9�{�zH��0���O!^���-��=����VM����u��c���9���c�cKB0,� -�0t22�@�w$<�����_�5��n�r\=�7�^�7����"����DA���P�W����/��'q�Tm��k��w��C�E�-9���1P�R�*N*�}?�c\U^�n
PU?'5��Iu���m�[����T8J��-�,�	�H$�a@zR�5F�jUM�@�R���xe:�X�+���ny~��kw
������d"�wP��0��g���,	kB�7!�|��.��T���{�|�]�xs��B-DQ�YHj�O����O�_�M&�t�1��t�����b�q����os��m�_����=}������T������"�w������{�1�����������5�����~��>��3��5����@�����H��r��D��A����JP�9�a7��uB) p��4a8��Bk�f��.�����f����ZL�]a�AL(�����;����u[����M������>�)���.i{I���h �_�Ge��~T!�
@����c$�8�k��;U�w�;��8N{]S�s ����Spw�5��lPE�[%E�n��V�+��[^������0���c���U��mM���9�Sj)����A���8]X*���;9�3�7h�VGFLH��9�[9 d-g��2�i%{����xf9���@��S$���M"�S�����!&���D���~�]��DY"l8�3L�����l��
+i{Nm�{�}X��{�:�k����;�����G>Xa�����S��/;I��&���2��bR��$K��N�/iP$#�KR�)�f�u�)
���oQ�qj��)��=��u]5y��e�Ua��O���.�z��I�C��_4����c�5�_f�1��X����w����==���}���x�7[od�~�{s��(h�J���!I����A�8�n����)!������0�j��8�|^��)��N"��W��GI�N6��<z�������A�G*$��b����
	��r�VPy�n
H#�������!;d���g�#}K�G��UFA7�v��;�n�������'�)@�w��#H�*�|?l�,���q
�{����
h�4C�.
(�6��.8�;����r)���\�@p�/5�n=H�@4�Q0��P�(**�k\9��(J���2�^)FG���g!��/���\T����1�rQ �6������y5U_��H)6g�RWp�R�v��$�0��z�R��DH����n�%���z](��TT!���J^��|^�5t������Z������,i']i�h���>d�|v�#������`���
��\uR���Cz�S�2�4m��Z�E��8���5NPqux6��0����%�@���x��b���6��Il��������s\��	��uX.2e?�7�S����uj������v9�c�N��{�.��H9H��uBM��$5}w'�H������x~��j�U7�R�������1B��6��
�E����TD��������Aqh��1,f�����n��n��e������� ����f���J\J%���}�yF�qDu��J�w8�F�����ns��y�����������6ki����V�,#�CVq���'����y%�e`U�y����P�?4h���x���h>�����*���7lZ�fJD+�L��:������g�uC�$��H?y��3��"�kG�GZ��D���O���]i]���\e��V&��|F����!�3��v���[ra/��^T�r�D.9����W;�@Xt���>P��ERY�'K��mB�%��3��q����33��6+B����LM�\����(u�8�)h�Mq�l�z����k���NCdM�M�0)���*d�h��=������f��!}�D*�����'�t�>������������������V�������h�=*dWO��gG"�Oc���Pk��1fX�I��^�1]�$�)8���zd�m�|���+d,��� �Y�TS�2Md���-bb����h��t�=��7�8����x���8q�-�����,�s�~3�t7�J�����zt���C+�c����)\8PD�u�f����P?lBi��)�,*J��������
U���$#W��~CV-9��*������$�E��b��3+,�1������kl8��vQY���~�@&��t�D���c�WW?�3 h������J�"���+	�k�������R�����@�����!���7�T�%�Ox������W,Ikoa��sR������BY��>�%�������Hz��;"C�K�������u�P������z{0&y@0ds���j_��(��-�<=h8�8�����2/��&�}p���p�)�kv�)��sR���?�kI��X��������}j�����h���i|�$N����2���	�f��cYtvK�4��5���h��$%�;_���'j��f<;�GJqz"��^)�s�Z�����.Q��_���.M��Hp������6���.�<���(|!8Kp�z�,��!_iPR��)M8�?�����U�0)��o)T�CE�.�gAWp�w���X����&d��������n=��8|?�N�YFZ��.#I��a���p��t��+�+�=oh :�k��^s$��']�2��i�
�~��0-��7[�D�e���S�}�G`N����I��tG�����x��(kLv�u��6����c�y�s�!���`���O���@�&h�c��uM�C��8��e���LL7���i���~�;e���$�wnX=���6��^�G�����h�3��f���O-�v�T
I^&vN�
a��EPg��%j��=!���h���NtK�/24��4@jNW�)������N��KD>0	+\Gl�|����,�^&�J'������:��������`��.+8�j��#��v4jEL��<e1�����Z��� "� �B�
�b�yvY%���,�fa2�	l�}m�5��V�E�t34YS�5	:_���9�&��>1��i2�vSix��'9�XD2$��O�:+1CR�Z���" G2a�&����$
���~���Ep�H����{��K.�6��|-�����^�^s�u�k@�z?��I]�T�����3M�5H�S0�n6�a(q��;�g�s���&��`����K��q����w]�B�l�#���2�dw78'�Bm<�t{�?y-�"JR�����*q��UM}2��68�r���V4�.��y��\���p���!s>c�3.���Fs�w/��������N�u}b��{�����kE-a��|��k"!�n�^�����$c���q��4�L�c�q��P���q���q����?�r������j�W����v3����3��:7j4�7��
l���T��\���� nA�����GVT^����P�eb�dY���"��:G�R�O���������C��~g����)��W���_>��{�H_�,�H1��&�P�u.$�$�	a_�VhK�C�)���l&�,hj�k�oP�8��1�d���sz�a6�7���wXK�H��.t�Rn�#r���w;�"������^z2Tn�ET+���R[��y��\�)t�|�~�<�3�{�3}D�Py�1Xf>��0�����#y�����>M��M��_R�M�.�8���`��WP����C�%	��r����~f��n�����w@�%z��e$�)���_�U8a 3	�|`��	���B�>Z\T
b��1Sb>wf�V�5{���^������]ws�U��k<bzF�`�0������J�r�x��1��m�y{�~�sVG!��$BM��I�(
���e-U��T������UF�Y��y�nO�":�k��z��u�����j�I��aL�A��"��F���h�uhU��2�h�,��#��1�����nA�]u27�����p��`(���^x���Z��Lvj��~t��	��_��Ze��q��%�4D���>Lc��������y����Nh�4���}Q����Kgj:}��~bDjP�~�Uv���b���W#P�5����V-c���`��@\�a���`c!b���zK��8�9N����Q��;ja�O���E
�W}��h�{��V�I,���']	2+N�n}|��u�����U=���~�=������_���vs`��3��WhQ�2P���&���R���W~���
��0�5�!�R�J/R?�����)�~��������m��N���c��09�w��;�����Wk�P�]CD��k�l)z��#+
9��[����@���������?{������f����]���?��������_�5+G`_�~����f�@���q���H�Y�l�QX0�M'��o*Ug�7g�"/~e�d����������,���	� ��
/U�@�K���;&�����������/�����
�����M��T�2��C��'z����?xl~�q��E����u[�����XO��m���Y����y��;f����}�2�@]�
C���Q} ��rj�V�	j�'�����td��a(��Pn#�*���Z����?��f;�h��o���������A������s�87�(��i����G���\�����!��|��
�����}5�'?��X$�
X�
��|���1�E�n��'41.}?h�\��mz���*�5/LW�������l_.�!?�|�-Z������	d(���2MrM���z��=�U�_��7�\Yn��U��	|��� �.C(�Y�F��`M�� ����qP�����@z�v�t��9?IE��,NsD��4$Q�i*�L�X-e�&6p-����z�6�}��H|
C�~�S�>+�����k���~V���!b�^6a���o*yc���^����rp�$��1��D�����7��f�`������ ����PU��79��Js~���g�����0�����]�P{��F�'���GI�'��g��T�U������tZ��F�p�������9�������e``���?������=i�w�#�����E�W}���>S����u�9v��/�l�9�^W n��S�B[�p$l3���T5����I9+���<��I����O%�
p��(P�o}����}��m��rwD?�m��m�?��E�^�|l����"��2�^'��K�����{~^��������^��h�c�y<
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kyotaro HORIGUCHI (#1)
Re: Removing useless #include's.

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:

While looking some patch, just from curiosity, I checked for
redundant #include's in the source tree (except
contrib). "redundant" here means that a file is included in
another include file nearby.

I found 641 includes that is just removable with no side effect
with two exceptions.

I tend to be a bit suspicious of this sort of thing, especially for
old files that have been through previous rounds of "unnecessary
include" removal. It's usually a good idea to ask *why* is a header
no longer needed? The answer, usually, is that somebody added the
same #include to some other header, and it's not uncommon for that
to have been a bad idea. It's usually best to minimize cross-header
inclusions, IMV, and it's always necessary to exercise judgment
when adding one.

We've also had more than a few problems with automatic scripts deciding
that an #include could be removed because they weren't testing with the
combination of build options that made it necessary.

See for instance commits 6416a82a6 through 1609797c2 for some history
of poorly managed #include removal.

regards, tom lane

#3Kyotaro HORIGUCHI
horiguchi.kyotaro@lab.ntt.co.jp
In reply to: Tom Lane (#2)
Re: Removing useless #include's.

Hello.

At Thu, 15 Feb 2018 11:12:05 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote in <6748.1518711125@sss.pgh.pa.us>

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:

While looking some patch, just from curiosity, I checked for
redundant #include's in the source tree (except
contrib). "redundant" here means that a file is included in
another include file nearby.

I found 641 includes that is just removable with no side effect
with two exceptions.

I tend to be a bit suspicious of this sort of thing, especially for
old files that have been through previous rounds of "unnecessary
include" removal. It's usually a good idea to ask *why* is a header
no longer needed? The answer, usually, is that somebody added the
same #include to some other header, and it's not uncommon for that
to have been a bad idea. It's usually best to minimize cross-header
inclusions, IMV, and it's always necessary to exercise judgment
when adding one.

As another point of view, placing an #include just because the
source file uses the definition in the file is also
reasonable. Header files are kept not to have a problem when
included multiple times. I don't surprise if someone says that
this is rather harmful. And I'm glas to read the clear reason.

We've also had more than a few problems with automatic scripts deciding
that an #include could be removed because they weren't testing with the
combination of build options that made it necessary.

See for instance commits 6416a82a6 through 1609797c2 for some history
of poorly managed #include removal.

I'm surprised to find no circular/mutual dependency even nor
multilevel inclusion among header files. I think I understand the
reason.

In this patch, I didn't touch the header files since I felt that
somewhat dangerous. But anyway I understand doing all of this at
a time can be dangerous.

Thank you for the suggestion, Tom.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kyotaro HORIGUCHI (#3)
Re: Removing useless #include's.

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:

At Thu, 15 Feb 2018 11:12:05 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote in <6748.1518711125@sss.pgh.pa.us>

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:

I found 641 includes that is just removable with no side effect
with two exceptions.

I tend to be a bit suspicious of this sort of thing, especially for
old files that have been through previous rounds of "unnecessary
include" removal.

As another point of view, placing an #include just because the
source file uses the definition in the file is also
reasonable. Header files are kept not to have a problem when
included multiple times. I don't surprise if someone says that
this is rather harmful. And I'm glas to read the clear reason.

Note that I'm *not* saying there's nothing to be done here. Scanning
through your patch quickly, the #include "postgres.h" in knapsack.h
is clearly contrary to project policy, and there should surely be
no need for any backend .c file to #include elog.h or palloc.h
because postgres.h pulls in both of those. But I'd like to see a bit
more analysis of most of the rest of these changes. The bad experience
we had with the last round of #include-removal was really because some
poor decisions had been taken before that about which headers should
include which other headers. I think it'd be a good idea to work backward
and see whether any of these proposed changes are pointing to header
inclusions that maybe weren't well thought out.

regards, tom lane