Re: typedef FileName not const?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Mark Dilger <hornschnorter(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: typedef FileName not const?
Date: 2016-09-28 00:16:07
Message-ID: 20160928001607.3occfnnmsipk4xio@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Can we please keep this topic in one thread? Anybody motivated to apply
these isn't going to have an easy time applying things, and everyone
else is just having a harder time sorting through the mails.

On 2016-09-27 17:08:24 -0700, Mark Dilger wrote:
> along the lines of other similar emails from me of late,
> I tried to avoid casting away const when using the FileName
> typedef. There are several calls where a (const char *) has to
> be cast to (char *) due to FileName being typedef'd as
> non-const. But changing the typedef to const doesn't seem to
> conflict with any code in the source tree.

I think the better fix here is to simply remove the typedef. It doesn't
seem to have much of a benefit, and makes using correct types harder as
demonstrated here. We don't even use it internally in fd.c..

Andres

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2016-09-28 00:26:17 Re: Supporting huge pages on Windows
Previous Message Mark Dilger 2016-09-28 00:08:24 typedef FileName not const?