On Mon, Mar 23, 2020 at 12:22:48AM -0400, Tom Lane wrote:
> Yeah, the comment needs an update; but if we have four implementations
> then it ought to describe each of them, IMO.
I got an idea as per the attached. Perhaps you have a better idea?
--
Michael
diff --git a/src/include/c.h b/src/includ
Michael Paquier writes:
> On Sat, Mar 21, 2020 at 07:22:41PM -0400, Tom Lane wrote:
>> Maybe we should just revert b7f64c64d instead of putting more time
>> into this. It's looking like we're going to end up with four or so
>> implementations no matter what, so it's getting hard to see any
>> rea
On Sat, Mar 21, 2020 at 07:22:41PM -0400, Tom Lane wrote:
> which of course is pointing at
>
> StaticAssertStmt(((int64) -1 >> 1) == (int64) -1,
> "arithmetic right shift is needed");
>
> so the existing "C and C++" fallback StaticAssertStmt doesn't work for
> older g++.
Michael Paquier writes:
> The fun does not stop here. gcc is fine when using that for C and
> C++:
> #define StaticAssertStmt(condition, errmessage) \
>do { struct static_assert_struct { int static_assert_failure : (condition)
> ? 1 : -1; }; } while(0)
> #define StaticAssertExpr(condition, e
On Mon, Mar 16, 2020 at 10:35:05PM -0400, Tom Lane wrote:
> Michael Paquier writes:
>> C++ does not allow defining a struct inside a sizeof() call, so in
>> this case StaticAssertExpr() does not work with the previous extension
>> in C++. StaticAssertStmt() does the work though.
>
> [ scratches
Michael Paquier writes:
> On Mon, Mar 16, 2020 at 10:32:36AM -0400, Tom Lane wrote:
>> Sorry for being unclear --- I just meant that we could use do{}
>> in StaticAssertStmt for both C and C++. Although now I notice
>> that the code is trying to use StaticAssertStmt for StaticAssertExpr,
>> which
On Mon, Mar 16, 2020 at 10:32:36AM -0400, Tom Lane wrote:
> Sorry for being unclear --- I just meant that we could use do{}
> in StaticAssertStmt for both C and C++. Although now I notice
> that the code is trying to use StaticAssertStmt for StaticAssertExpr,
> which you're right isn't going to do
Michael Paquier writes:
> On Fri, Mar 13, 2020 at 11:00:33AM -0400, Tom Lane wrote:
>> If we do need to change it, I'd be inclined to just use the do{}
>> block everywhere, not bothering with the extra #if test.
> Not sure what you mean here because we cannot use the do{} flavor
> either for the
On Fri, Mar 13, 2020 at 11:00:33AM -0400, Tom Lane wrote:
> Michael Paquier writes:
>> Hmm. v3 actually broke the C++ fallback of StaticAssertExpr() and
>> StaticAssertStmt() (v1 did not), a simple fix being something like
>> the attached.
>
> The buildfarm seems happy, so why do you think it's
Michael Paquier writes:
> Hmm. v3 actually broke the C++ fallback of StaticAssertExpr() and
> StaticAssertStmt() (v1 did not), a simple fix being something like
> the attached.
The buildfarm seems happy, so why do you think it's broken?
If we do need to change it, I'd be inclined to just use th
On Fri, Mar 13, 2020 at 03:12:34PM +0900, Michael Paquier wrote:
> On Thu, Mar 12, 2020 at 09:43:54AM -0400, Tom Lane wrote:
>> I don't feel a need to expend a whole lot of sweat there. The existing
>> text is fine, it just bugged me that the code deals with three cases
>> while the comment block
On Thu, Mar 12, 2020 at 09:43:54AM -0400, Tom Lane wrote:
> I don't feel a need to expend a whole lot of sweat there. The existing
> text is fine, it just bugged me that the code deals with three cases
> while the comment block only acknowledged two. So I'd just go with
> what you have in v3.
Th
Michael Paquier writes:
> So, should we add a reference about both in the new comment? I would
> actually not add them, so I have used your suggestion in the attached,
> but the comment block above does that for _Static_assert(). Do you
> think it is better to add some references to some of thos
On Thu, Mar 12, 2020 at 12:33:21AM -0400, Tom Lane wrote:
> I looked at this and tried it on an old (non HAVE__STATIC_ASSERT)
> gcc version. Seems to work, but I have a couple cosmetic suggestions:
Thanks for the review.
> 1. The comment block above this was never updated to mention that
> we're
Michael Paquier writes:
> Indeed the bot is happy now. By looking at the patch, one would note
> that what it just does is unifying the fallback "hack-ish"
> implementations so as C and C++ use the same thing, which is the
> fallback implementation for C of HEAD. I would prefer hear first from
>
On Wed, Mar 11, 2020 at 12:31:19PM +, Georgios Kokolatos wrote:
> For whatever is worth, my previous comment that the patch improves
> readability also applies to the updated version of the patch.
v2 has actually less diffs for the C++ part.
> The CF bot seems happy now, which means that your
Thank you for updating the status of the issue.
I have to admit that I completely missed the CF bot. Lesson learned.
For whatever is worth, my previous comment that the patch improves
readability also applies to the updated version of the patch.
The CF bot seems happy now, which means that your
On Sat, Mar 07, 2020 at 04:44:48PM -0500, Tom Lane wrote:
> cfbot reports this doesn't work with MSVC. Not sure why --- maybe
> it defines __cpp_static_assert differently than you're expecting?
I don't think that's the issue. The CF bot uses MSVC 12.0 which
refers to the 2013. __cpp_static_asse
Michael Paquier writes:
> As of [1], I have been playing with the compile time assertions that
> we have for expressions, declarations and statements. And it happens
> that it is visibly possible to consolidate the fallback
> implementations for C and C++. Attached is the result of what I am
> g
The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: not tested
Documentation:not tested
In my humble opinion the patch improves readability, hence gets my +1.
No fu
Hi all,
As of [1], I have been playing with the compile time assertions that
we have for expressions, declarations and statements. And it happens
that it is visibly possible to consolidate the fallback
implementations for C and C++. Attached is the result of what I am
getting at. I am adding th
21 matches
Mail list logo