Thread

Commits

  1. Assume "inline" keyword is available.

  1. assume availability of "inline" keyword

    Nathan Bossart <nathandbossart@gmail.com> — 2026-02-19T17:20:44Z

    I noticed some code that uses __inline__ (which IIUC is a gcc extension) as
    well as a related configure check.  "inline" was first added to C99, and we
    now require C11, so we can just assume it's there, right?  FWIW it looks
    like meson builds don't bother checking this.
    
    -- 
    nathan
    
  2. Re: assume availability of "inline" keyword

    Tom Lane <tgl@sss.pgh.pa.us> — 2026-02-19T19:19:33Z

    Nathan Bossart <nathandbossart@gmail.com> writes:
    > I noticed some code that uses __inline__ (which IIUC is a gcc extension) as
    > well as a related configure check.  "inline" was first added to C99, and we
    > now require C11, so we can just assume it's there, right?  FWIW it looks
    > like meson builds don't bother checking this.
    
    All those usages are guarded by
    
    #if defined(__GNUC__) || defined(__INTEL_COMPILER)
    
    so we are only concerned with gcc-alikes, which reduces the risks
    of trouble.  However, I have a vague recollection that it is/was
    possible to put gcc in a mode where it only takes __inline__
    not inline.  This is likely something you get from -std=c90 or
    thereabouts, which would be irrelevant now.  But I'd suggest
    checking it's okay under -std=c11 (not gnu11), just to be sure.
    
    			regards, tom lane
    
    
    
    
  3. Re: assume availability of "inline" keyword

    Nathan Bossart <nathandbossart@gmail.com> — 2026-02-19T19:54:23Z

    On Thu, Feb 19, 2026 at 02:19:33PM -0500, Tom Lane wrote:
    > All those usages are guarded by
    > 
    > #if defined(__GNUC__) || defined(__INTEL_COMPILER)
    > 
    > so we are only concerned with gcc-alikes, which reduces the risks
    > of trouble.  However, I have a vague recollection that it is/was
    > possible to put gcc in a mode where it only takes __inline__
    > not inline.  This is likely something you get from -std=c90 or
    > thereabouts, which would be irrelevant now.  But I'd suggest
    > checking it's okay under -std=c11 (not gnu11), just to be sure.
    
    Right.  I checked a couple of compilers and none seemed to mind this patch
    with -std=c11.
    
    -- 
    nathan
    
    
    
    
  4. Re: assume availability of "inline" keyword

    Nathan Bossart <nathandbossart@gmail.com> — 2026-02-19T20:40:59Z

    Committed.
    
    -- 
    nathan