Missing some ifndef FRONTEND at the top of logging.c and file_utils.c

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Missing some ifndef FRONTEND at the top of logging.c and file_utils.c

Michael Paquier-2
Hi all,

As subject tells, we have in src/common/ four files that are only
compiled as part of the frontend: fe_memutils.c, file_utils.c,
logging.c and restricted_token.c.  Two of them are missing the
following, to make sure that we never try to compile them with the
backend:
+#ifndef FRONTEND
+#error "This file is not expected to be compiled for backend code"
+#endif

So, shouldn't that stuff be added as per the attached?

Thanks.
--
Michael

common-fe-v1.patch (844 bytes) Download Attachment
signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Missing some ifndef FRONTEND at the top of logging.c and file_utils.c

Daniel Gustafsson
> On 25 Jun 2020, at 10:07, Michael Paquier <[hidden email]> wrote:

> So, shouldn't that stuff be added as per the attached?

That makes sense, logging.c and file_utils.c are indeed only part of
libpgcommon.a and should only be compiled for frontend.

cheers ./daniel


Reply | Threaded
Open this post in threaded view
|

Re: Missing some ifndef FRONTEND at the top of logging.c and file_utils.c

Michael Paquier-2
On Thu, Jun 25, 2020 at 11:15:03AM +0200, Daniel Gustafsson wrote:
> That makes sense, logging.c and file_utils.c are indeed only part of
> libpgcommon.a and should only be compiled for frontend.

Thanks.  This list is provided by OBJS_FRONTEND in
src/common/Makefile, and pgcommonfrontendfiles in Mkvcbuild.pm.  Let's
see if others have comments, as it just looks like something that was
forgotten in bf5bb2e and fc9a62a when this code was moved to
src/common/.  If there are no objections, I'll revisit that some time
next week and fix it on HEAD.
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Missing some ifndef FRONTEND at the top of logging.c and file_utils.c

Michael Paquier-2
On Fri, Jun 26, 2020 at 09:59:30AM +0900, Michael Paquier wrote:
> Thanks.  This list is provided by OBJS_FRONTEND in
> src/common/Makefile, and pgcommonfrontendfiles in Mkvcbuild.pm.  Let's
> see if others have comments, as it just looks like something that was
> forgotten in bf5bb2e and fc9a62a when this code was moved to
> src/common/.  If there are no objections, I'll revisit that some time
> next week and fix it on HEAD.

And committed as of 324435e.
--
Michael

signature.asc (849 bytes) Download Attachment