Skip to content

Cap'n Proto 0.9 & 0.10 capnp/blob.h error: invalid operands to binary expression ('const char *' and 'kj::StringPtr') #199

@ryanofsky

Description

@ryanofsky

Cap'n Proto versions 0.9.x and 0.10.x are incompatible with clang 16 and later when -std=c++20 is used, causing error:

/usr/include/capnp/blob.h:176:74: error: invalid operands to binary expression ('const char *' and 'kj::StringPtr')

This was reported by willcl-ark in #194 (comment) and maflcko in #194 (comment)

This error can be avoided by any of the following:

  • Upgrading to Cap'n Proto version 1.0 or newer which fixed this in capnproto/capnproto#1618, or applying the patch as done in shell.nix.
  • Downgrading to Cap'n Proto version 0.8 or earlier, before capnproto/capnproto#1170 which triggers this issue starting in version 0.9.
  • Downgrading to clang-15 or earlier, before P2468R2 which triggers this issue starting in version 16.
  • Maybe using GCC (not sure what the status of this is with GCC)

Background

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions