Superfluous libpq-be.h include in GSSAPI code

Started by Daniel Gustafssonover 6 years ago4 messages
#1Daniel Gustafsson
daniel@yesql.se
1 attachment(s)

backend/libpq/be-secure-gssapi.c is including both libpq-be.h and libpq.h,
which makes libpq-be.h superfluous as it gets included via libpq.h. The
attached patch removes the inclusion of libpq-be.h to make be-secure-gssapi.c
behave like other files which need both headers.

cheers ./daniel

Attachments:

gssapi_header.patchapplication/octet-stream; name=gssapi_header.patch; x-unix-mode=0644Download
From d8b1277a934e8ab5c39c1944199729b5d034a70c Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <daniel@yesql.se>
Date: Fri, 28 Jun 2019 16:12:59 +0200
Subject: [PATCH] Remove superfluous header include

libpq/libpq-be.h is included by libpq/libpq.h so there is no need to
explicitly include it separately.
---
 src/backend/libpq/be-secure-gssapi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backend/libpq/be-secure-gssapi.c b/src/backend/libpq/be-secure-gssapi.c
index ba8c0cd0f0..92f39c113a 100644
--- a/src/backend/libpq/be-secure-gssapi.c
+++ b/src/backend/libpq/be-secure-gssapi.c
@@ -19,7 +19,6 @@
 #include "libpq/auth.h"
 #include "libpq/be-gssapi-common.h"
 #include "libpq/libpq.h"
-#include "libpq/libpq-be.h"
 #include "libpq/pqformat.h"
 #include "miscadmin.h"
 #include "pgstat.h"
-- 
2.14.1.145.gb3622a4ee

#2Julien Rouhaud
rjuju123@gmail.com
In reply to: Daniel Gustafsson (#1)
Re: Superfluous libpq-be.h include in GSSAPI code

On Fri, Jun 28, 2019 at 4:37 PM Daniel Gustafsson <daniel@yesql.se> wrote:

backend/libpq/be-secure-gssapi.c is including both libpq-be.h and libpq.h,
which makes libpq-be.h superfluous as it gets included via libpq.h. The
attached patch removes the inclusion of libpq-be.h to make be-secure-gssapi.c
behave like other files which need both headers.

LGTM.

#3Michael Paquier
michael@paquier.xyz
In reply to: Julien Rouhaud (#2)
Re: Superfluous libpq-be.h include in GSSAPI code

On Fri, Jun 28, 2019 at 08:47:33PM +0200, Julien Rouhaud wrote:

On Fri, Jun 28, 2019 at 4:37 PM Daniel Gustafsson <daniel@yesql.se> wrote:

backend/libpq/be-secure-gssapi.c is including both libpq-be.h and libpq.h,
which makes libpq-be.h superfluous as it gets included via libpq.h. The
attached patch removes the inclusion of libpq-be.h to make be-secure-gssapi.c
behave like other files which need both headers.

LGTM.

Thanks, committed. I looked at the area in case but did not notice
anything else strange.

(We have in hba.h a kludge with hbaPort to avoid including libpq-be.h,
I got to wonder if we could do something about that..)
--
Michael

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Michael Paquier (#3)
Re: Superfluous libpq-be.h include in GSSAPI code

On 29 Jun 2019, at 04:23, Michael Paquier <michael@paquier.xyz> wrote:

On Fri, Jun 28, 2019 at 08:47:33PM +0200, Julien Rouhaud wrote:

On Fri, Jun 28, 2019 at 4:37 PM Daniel Gustafsson <daniel@yesql.se> wrote:

backend/libpq/be-secure-gssapi.c is including both libpq-be.h and libpq.h,
which makes libpq-be.h superfluous as it gets included via libpq.h. The
attached patch removes the inclusion of libpq-be.h to make be-secure-gssapi.c
behave like other files which need both headers.

LGTM.

Thanks, committed. I looked at the area in case but did not notice
anything else strange.

Thanks!

(We have in hba.h a kludge with hbaPort to avoid including libpq-be.h,
I got to wonder if we could do something about that..)

I looked at that one too at the time, but didn’t come up with anything less
kludgy.

cheers ./daniel