Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix 64-bit shifting in dynahash.c

  2. MSVC: Turn missing function declaration into an error

  3. Add missing include

  4. Add backtrace support for Windows using DbgHelp API

  5. Change dynahash.c and hsearch.h to use int64 instead of long

  1. some extra warnings from MSVC

    Peter Eisentraut <peter@eisentraut.org> — 2026-04-11T10:37:15Z

    I ran the MSVC build with the warning level set one level higher than 
    the default (that is, meson -Dwarning_level=2, which actually maps to 
    what MSVC considers its level 3), and it gave two new warnings that 
    should be fixed:
    
    ../src/backend/utils/error/elog.c(1255): warning C4013: 'wchar2char' 
    undefined; assuming extern returning int
    
    ../src/backend/utils/hash/dynahash.c(1767): warning C4334: '<<': result 
    of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
    
    These are both in code that is new in PG19.
    
    The first one is from commit 65707ed9afc (Add backtrace support for 
    Windows).  This would be an error in gcc (from C99 on); it's kind of 
    incredible that MSVC doesn't even warn about this by default.  I propose 
    to add this warning category to the default set.
    
    (Second thought: For consistency, make this an error, with '/we4013' 
    instead of '/w24013'.)
    
    The second one is from commit 13b935cd521 (Change dynahash.c and 
    hsearch.h to use int64 instead of long).  I don't have a patch here to 
    include this in the default warning set, mainly because it doesn't 
    appear to map to any gcc warning option, but maybe we should add it 
    anyway, since it can catch this kind of 4-byte-long-on-Windows issue.
    
  2. Re: some extra warnings from MSVC

    Tom Lane <tgl@sss.pgh.pa.us> — 2026-04-11T14:09:58Z

    Peter Eisentraut <peter@eisentraut.org> writes:
    > The first one is from commit 65707ed9afc (Add backtrace support for 
    > Windows).  This would be an error in gcc (from C99 on); it's kind of 
    > incredible that MSVC doesn't even warn about this by default.  I propose 
    > to add this warning category to the default set.
    > (Second thought: For consistency, make this an error, with '/we4013' 
    > instead of '/w24013'.)
    
    +1 for making it an error.
    
    > The second one is from commit 13b935cd521 (Change dynahash.c and 
    > hsearch.h to use int64 instead of long).  I don't have a patch here to 
    > include this in the default warning set, mainly because it doesn't 
    > appear to map to any gcc warning option, but maybe we should add it 
    > anyway, since it can catch this kind of 4-byte-long-on-Windows issue.
    
    I think it'd be a good idea to warn even if we can't make gcc do that.
    I think Windows is the only 64-bit platform we deal with where long
    is just 32 bits, so covering the case in MSVC will expose bugs we
    would not notice otherwise.
    
    			regards, tom lane
    
    
    
    
  3. Re: some extra warnings from MSVC

    Michael Paquier <michael@paquier.xyz> — 2026-04-19T22:18:37Z

    On Sat, Apr 11, 2026 at 10:09:58AM -0400, Tom Lane wrote:
    > I think it'd be a good idea to warn even if we can't make gcc do that.
    > I think Windows is the only 64-bit platform we deal with where long
    > is just 32 bits, so covering the case in MSVC will expose bugs we
    > would not notice otherwise.
    
    Interesting issue.  I did not notice this thread until 9018c7d37bb4.
    Please do not hesitate to add me in CC in the future, as 13b935cd521
    has my fingerprints.  Thanks for fixing the issue.
    --
    Michael