Thread

Commits

  1. Add type cast to foreach_internal's loop variable.

  1. Make foreach_ptr macro work in C++ extensions

    Jelte Fennema-Nio <postgres@jeltef.nl> — 2024-10-14T20:05:42Z

    I've been writing a C++ extension recently and it turns out that the
    foreach_ptr macro added in PG17 by one of my patches causes a
    compilation failure when used in C++. This is due to C++ its stricter
    rules around implicit casts from void pointers.
    
    Attached is a tiny patch that fixes that by adding an explicit cast to
    the macro. I think it would be good to backpatch this to PG17 as well,
    as to not introduce some differences in the macro across versions.
    
    (CCed Nathan because he committed the original patch)
    
  2. Re: Make foreach_ptr macro work in C++ extensions

    Nathan Bossart <nathandbossart@gmail.com> — 2024-10-14T20:29:34Z

    On Mon, Oct 14, 2024 at 10:05:42PM +0200, Jelte Fennema-Nio wrote:
    > I've been writing a C++ extension recently and it turns out that the
    > foreach_ptr macro added in PG17 by one of my patches causes a
    > compilation failure when used in C++. This is due to C++ its stricter
    > rules around implicit casts from void pointers.
    
    Whoops.
    
    > Attached is a tiny patch that fixes that by adding an explicit cast to
    > the macro.
    
    Looks reasonable to me.
    
    > I think it would be good to backpatch this to PG17 as well,
    > as to not introduce some differences in the macro across versions.
    
    I'd consider this a "low-risk" fix, which our versioning page [0] says is
    acceptable for a minor release, so I'll plan on back-patching unless
    someone objects.
    
    [0] https://www.postgresql.org/support/versioning/
    
    -- 
    nathan
    
    
    
    
  3. Re: Make foreach_ptr macro work in C++ extensions

    Bruce Momjian <bruce@momjian.us> — 2024-10-14T20:31:59Z

    On Mon, Oct 14, 2024 at 03:29:34PM -0500, Nathan Bossart wrote:
    > > I think it would be good to backpatch this to PG17 as well,
    > > as to not introduce some differences in the macro across versions.
    > 
    > I'd consider this a "low-risk" fix, which our versioning page [0] says is
    > acceptable for a minor release, so I'll plan on back-patching unless
    > someone objects.
    
    Agreed.
    
    -- 
      Bruce Momjian  <bruce@momjian.us>        https://momjian.us
      EDB                                      https://enterprisedb.com
    
      When a patient asks the doctor, "Am I going to die?", he means 
      "Am I going to die soon?"
    
    
    
    
  4. Re: Make foreach_ptr macro work in C++ extensions

    Nathan Bossart <nathandbossart@gmail.com> — 2024-10-15T21:25:50Z

    Committed.
    
    -- 
    nathan