Skip to content

build: assume stdint.h#20406

Closed
vszakats wants to merge 8 commits intocurl:masterfrom
vszakats:stdint
Closed

build: assume stdint.h#20406
vszakats wants to merge 8 commits intocurl:masterfrom
vszakats:stdint

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Jan 23, 2026

curl requires stdint.h from C99, and no longer builds without it since
v8.18.0 (after dropping VS2008 support). Assume it's available, drop
feature checks.

Also:

  • drop duplicate stdint.h includes.
  • introduce internal HAVE_UINTPTR_T, enabled by default.
  • OS400: disable HAVE_UINTPTR_T.
  • build: keep cmake pre-fill and cmp-config.pl exception because cmake
    and autotools both detect stdint.h implicitly.

Co-authored-by: Dan Fandrich
Ref: #20405
Ref: #20384
Follow-up to 2e1a045 #17931

lib/curl_setup.h Outdated

/* Set uintptr_t to fallback type for targets known to miss it from stdint.h */
#ifdef __OS400__
#define uintptr_t void *
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hesitant to do this. IIUC OS400 doesn't define this since it doesn't make sense on that platform, so defining our own version could cause confusion. For our purposes today this will work, but it's not strictly correct. I would prefer having an OS400 exception and keeping the two !HAVE_STDINT_H paths for it to use.

Copy link
Copy Markdown
Member Author

@vszakats vszakats Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to do it differently, yes.

The alterative I had in mind was a HAVE_UINPTR_T, which gets defined by default,
and e.g. config-os400.h #undef-ing it for OS400. Or something along these lines.
And keep the fallbacks in formdata.c and for CURL_UNCONST().

edit: I'll also keep MISSING_UINTPTR_T in mind, it may simplify things.

I'll push an update tomorrow.

@vszakats vszakats marked this pull request as ready for review January 23, 2026 12:12
vszakats added a commit that referenced this pull request Jan 23, 2026
@testclutch

This comment was marked as outdated.

@vszakats vszakats closed this in feb52be Jan 28, 2026
@vszakats vszakats deleted the stdint branch January 28, 2026 11:06
dfandrich added a commit that referenced this pull request Jan 28, 2026
These are requirements above and above C89.

Ref: #20406

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

Development

Successfully merging this pull request may close these issues.

3 participants