Skip to content

ws: -Wtype-limits warning in ws_payload_remain() #19017

@vszakats

Description

@vszakats

I did this

Built curl for MS-DOS in CI, where the build reaches this line due to SIZEOF_OFF_T <= SIZEOF_SIZE_T (4 <= 4):

lib/ws.c: In function 'ws_payload_remain':
lib/ws.c:658:35: error: comparison is always false due to limited range of data type [-Werror=type-limits]
  658 |   if((curl_off_t)payload_buffered < 0)
      |                                   ^

https://github.com/curl/curl/actions/runs/18420572155/job/52493664744?pr=18039#step:9:27

Ref: a4d3c4e #18965

I expected the following

Clean build.

curl/libcurl version

master

operating system

MS-DOS (maybe others with SIZEOF_OFF_T <= SIZEOF_SIZE_T)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions