Relying on stdint.h in krb5

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Relying on stdint.h in krb5

Greg Hudson
http://k5wiki.kerberos.org/wiki/Portability_assumptions currently says
"The C99 stdint.h or inttypes.h capabilities should be available."

I would like to change this to specifically require stdint.h, so that we
can include it unconditionally in public headers.  C99 specifies
<stdint.h> to declare the fixed-width typedefs and min/max constants,
and <inttypes.h> to declare those as well as the printf format
specifiers and some utility functions.  Right now we only need the
fixed-width type names; we don't need any of the extra stuff in
inttypes.h.

According to my notes, MSVC provides <stdint.h> as of SDK 7.1, but not
<inttypes.h>.  I believe <stdint.h> is available on every Unix-like
platform we would want to support.

I've prototyped some changes at
https://github.com/greghudson/krb5/commits/stdint which get rid of a
bunch of autoconf goo and use standard names for 64-bit types.

I would also like to stop using (but continue declaring)
krb5_int32/krb5_ui_4/krb5_int16/krb5_ui_2 in favor of
int32_t/uint32_t/int16_t/uint16_t, but that's a big change, so I'm going
to defer it until I see how this discussion goes.
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Relying on stdint.h in krb5

Russ Allbery-2
Greg Hudson <[hidden email]> writes:

> http://k5wiki.kerberos.org/wiki/Portability_assumptions currently says
> "The C99 stdint.h or inttypes.h capabilities should be available."

> I would like to change this to specifically require stdint.h, so that we
> can include it unconditionally in public headers.  C99 specifies
> <stdint.h> to declare the fixed-width typedefs and min/max constants,
> and <inttypes.h> to declare those as well as the printf format
> specifiers and some utility functions.  Right now we only need the
> fixed-width type names; we don't need any of the extra stuff in
> inttypes.h.

> According to my notes, MSVC provides <stdint.h> as of SDK 7.1, but not
> <inttypes.h>.  I believe <stdint.h> is available on every Unix-like
> platform we would want to support.

https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
says that you would lose on HP-UX 11.11, AIX 5.1, IRIX 6.5, and OpenBSD
3.8.  That seems acceptable to me given the current portability
requirements.  Those are pretty old platforms.

--
Russ Allbery ([hidden email])              <http://www.eyrie.org/~eagle/>
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev
Reply | Threaded
Open this post in threaded view
|

Re: Relying on stdint.h in krb5

Nico Williams
In reply to this post by Greg Hudson
The approach taken in Heimdal is to generate a stdint.h if there's not
one on the host OS.  This works reasonably well.
_______________________________________________
krbdev mailing list             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev