unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Thoughts about using inttypes.h
@ 2003-02-16 22:29 Rob Browning
  2003-02-17 12:13 ` Mikael Djurfeldt
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Browning @ 2003-02-16 22:29 UTC (permalink / raw)



The new C99 standard requires inttypes.h:

  - New <inttypes.h>, giving typedefs specifying integer types with

      * exactly n bits
      * at least n bits
      * the fastest (whatever that means) type having at least n bits
        where n in [8, 16, 32, 64]. Also defines for each of these
        types macros expanding to the correct format specifiers for
        the printf and scanf families, as well as macros expanding to
        the correct suffixes for constants (e.g., UINT64_C (0x123)
        might expand to 0x123ULL) and for the maximum and minimum
        values of these types.

I'm considering the possiblity of using this header, or at least some
of the provided type names in Guile.  The idea would be to use this
header on those platforms where whe find it, and to declare the
relevant typedefs ourselves on platforms where we don't.

The reason I bring this up is that I've come across some places in the
code where we make assumptions about the sizes of various types (like
char, int, etc.), and I'd like to fix that, but it would be a lot
easier to fix without undue #ifdef and configure.in complexity, if we
had some known size integral types.

Anyone opposed?

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Thoughts about using inttypes.h
  2003-02-16 22:29 Thoughts about using inttypes.h Rob Browning
@ 2003-02-17 12:13 ` Mikael Djurfeldt
  2003-02-17 18:42   ` Rob Browning
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Djurfeldt @ 2003-02-17 12:13 UTC (permalink / raw)
  Cc: guile-devel

Rob Browning <rlb@defaultvalue.org> writes:

> The new C99 standard requires inttypes.h:
>
>   - New <inttypes.h>, giving typedefs specifying integer types with
>
>       * exactly n bits
>       * at least n bits
>       * the fastest (whatever that means) type having at least n bits
>         where n in [8, 16, 32, 64]. Also defines for each of these
>         types macros expanding to the correct format specifiers for
>         the printf and scanf families, as well as macros expanding to
>         the correct suffixes for constants (e.g., UINT64_C (0x123)
>         might expand to 0x123ULL) and for the maximum and minimum
>         values of these types.
>
> I'm considering the possiblity of using this header, or at least some
> of the provided type names in Guile.  The idea would be to use this
> header on those platforms where whe find it, and to declare the
> relevant typedefs ourselves on platforms where we don't.
>
> The reason I bring this up is that I've come across some places in the
> code where we make assumptions about the sizes of various types (like
> char, int, etc.), and I'd like to fix that, but it would be a lot
> easier to fix without undue #ifdef and configure.in complexity, if we
> had some known size integral types.
>
> Anyone opposed?

I'm not.  It sounds excellent.

Mikael


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Thoughts about using inttypes.h
  2003-02-17 12:13 ` Mikael Djurfeldt
@ 2003-02-17 18:42   ` Rob Browning
  2003-02-17 21:34     ` Mikael Djurfeldt
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Browning @ 2003-02-17 18:42 UTC (permalink / raw)
  Cc: guile-devel

Mikael Djurfeldt <djurfeldt@nada.kth.se> writes:

>> Anyone opposed?
>
> I'm not.  It sounds excellent.

OK.  I'll wait a bit longer for any other counter arguments, but if
there are none, I'll go ahead.

Thanks

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Thoughts about using inttypes.h
  2003-02-17 18:42   ` Rob Browning
@ 2003-02-17 21:34     ` Mikael Djurfeldt
  2003-02-18 17:26       ` Marius Vollmer
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Djurfeldt @ 2003-02-17 21:34 UTC (permalink / raw)
  Cc: djurfeldt

Rob Browning <rlb@defaultvalue.org> writes:

> Mikael Djurfeldt <djurfeldt@nada.kth.se> writes:
>
>>> Anyone opposed?
>>
>> I'm not.  It sounds excellent.
>
> OK.  I'll wait a bit longer for any other counter arguments, but if
> there are none, I'll go ahead.

Yeah.  Since it's a change in policy, so to say, it might be good that
Marius have a say in it, though.

Mikael


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Thoughts about using inttypes.h
  2003-02-17 21:34     ` Mikael Djurfeldt
@ 2003-02-18 17:26       ` Marius Vollmer
  2003-02-18 17:34         ` Rob Browning
  0 siblings, 1 reply; 6+ messages in thread
From: Marius Vollmer @ 2003-02-18 17:26 UTC (permalink / raw)
  Cc: Rob Browning

Mikael Djurfeldt <djurfeldt@nada.kth.se> writes:

> Yeah.  Since it's a change in policy, so to say, it might be good that
> Marius have a say in it, though.

Hmm, it's only about internal use of integer types, right?  We
shouldn't change all exported functions from "int" to something else,
of course.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Thoughts about using inttypes.h
  2003-02-18 17:26       ` Marius Vollmer
@ 2003-02-18 17:34         ` Rob Browning
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Browning @ 2003-02-18 17:34 UTC (permalink / raw)
  Cc: djurfeldt

Marius Vollmer <mvo@zagadka.de> writes:

> Hmm, it's only about internal use of integer types, right?  We
> shouldn't change all exported functions from "int" to something else,
> of course.

Absolutely, though there might be some cases where using int_u8 in the
API, or whatever they call it, might be more appropriate than char.
However, the main thing I'm talking about is fixing internal uses of
char, int, etc., esp in situations like WORDS_BIGENDIAN related
bit-fiddling operations.

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-18 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-16 22:29 Thoughts about using inttypes.h Rob Browning
2003-02-17 12:13 ` Mikael Djurfeldt
2003-02-17 18:42   ` Rob Browning
2003-02-17 21:34     ` Mikael Djurfeldt
2003-02-18 17:26       ` Marius Vollmer
2003-02-18 17:34         ` Rob Browning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).