Skip to content

Compiler warnings on quic/streams.cc #60110

Description

@targos
[4376/4521] CXX obj/src/quic/libnode.streams.o
../../src/quic/streams.cc:842:13: warning: comparison of integers of different signs: 'stream_id' (aka 'long long') and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
  842 |   DCHECK(id < kMaxStreamId);
      |          ~~ ^ ~~~~~~~~~~~~
../../src/util.h:195:30: note: expanded from macro 'DCHECK'
  195 |   #define DCHECK(expr) CHECK(expr)
      |                              ^~~~
../../src/util.h:179:11: note: expanded from macro 'CHECK'
  179 |     if (!(expr)) [[unlikely]] {                                                \
      |           ^~~~
../../src/quic/streams.cc:899:13: warning: comparison of integers of different signs: 'stream_id' (aka 'long long') and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
  899 |   DCHECK(id < kMaxStreamId);
      |          ~~ ^ ~~~~~~~~~~~~
../../src/util.h:195:30: note: expanded from macro 'DCHECK'
  195 |   #define DCHECK(expr) CHECK(expr)
      |                              ^~~~
../../src/util.h:179:11: note: expanded from macro 'CHECK'
  179 |     if (!(expr)) [[unlikely]] {                                                \
      |           ^~~~
2 warnings generated.

@nodejs/quic

Activity

  1. added
    quicIssues and PRs related to the QUIC transport implementation.
    on Oct 3, 2025
  2. xiaocainiao633 commented on Oct 4, 2025

    @xiaocainiao633
    Contributor

    I think the cause of the problem is that sizeof_t is an unsigned number, while id is of type long long. There will be problems when comparing an unsigned number with a signed number. It may be effective to eliminate the type mismatch problem through type conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    quicIssues and PRs related to the QUIC transport implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions