Skip to content

cmake doesn't figure out CURL_SA_FAMILY_T - build causes warnings #7049

Closed
@bagder

Description

@bagder

I did this

built curl with cmake on macOS

It cases warnings like:

/Users/runner/work/curl/curl/lib/curl_addrinfo.c:329:26: warning: conversion from 'short unsigned int' to 'sa_family_t' {aka 'unsigned char'} may change value [-Wconversion]
  329 |       addr->sin_family = (CURL_SA_FAMILY_T)(he->h_addrtype);
      |                          ^
/Users/runner/work/curl/curl/lib/curl_addrinfo.c:338:28: warning: conversion from 'short unsigned int' to 'sa_family_t' {aka 'unsigned char'} may change value [-Wconversion]
  338 |       addr6->sin6_family = (CURL_SA_FAMILY_T)(he->h_addrtype);
      |                            ^

... because the cmake build doesn't detect CURL_SA_FAMILY_T properly. configure does.

I expected the following

No warnings

curl/libcurl version

curl 7.76.1 and current curl git master

operating system

macOS but probably also elsewhere

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions