Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Phil Carmody <thefatphil_demunged@yahoo.co.uk> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Am I being too C++ like? |
| Date | 2012-02-11 23:46 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <87bop5ujp3.fsf@bazspaz.fatphil.org> (permalink) |
| References | (9 earlier) <lny5t1x6at.fsf@nuthaus.mib.org> <20120120161306.691@kylheku.com> <7ghpu8-nmr.ln1@wilbur.25thandClement.com> <20120120225726.465@kylheku.com> <0.0be6b7a95283e0f392f2.20120121212513GMT.87wr8kkati.fsf@bsb.me.uk> |
Late to the party. Usenet is an occasional treat currently.
Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> Kaz Kylheku <kaz@kylheku.com> writes:
>
> > On 2012-01-21, William Ahern <william@wilbur.25thandClement.com> wrote:
> >> Kaz Kylheku <kaz@kylheku.com> wrote:
> >>> On 2012-01-21, Keith Thompson <kst-u@mib.org> wrote:
> >>> > Do you know of any systems that support uint128_t?
> >>
> >>> gcc
> >>
> >> GCC has __uint128_t and __int128_t on a few platforms, but there's no
> >> typedefs for uint128_t or int128_t.
> >
> > typedef __uint128_t uint128_t;
> >
> >> And there's no UINT128_C, INT128_C, or
> >> equivalents, which makes it difficult to use 128-bit constants.
> >
> > #define UINT128_C(X) ((uint128_t) (X))
>
> I don't see how that is supposed to work:
>
> #include <stdio.h>
>
> typedef __uint128_t uint128_t;
> #define UINT128_C(X) ((uint128_t) (X))
>
> int main(void)
> {
> uint128_t j = UINT128_C(0x10000000000000000ULL);
Don't force it to be a ULL before casting it to the 128-bit type then?
> puts(j ? "ok" : "fail");
> return 0;
> }
>
> prints "fail" (with a compiler-time warning about the constant being too
> large for its type).
>
> The UINTx_C macros usually need compiler magic and the manual says:
>
> "There is no support in GCC to express an integer constant of type
> __int128 for targets having long long integer with less then 128 bit
> width"
Yikes, they did indeed write "less then".
Phil
--
Unix is simple. It just takes a genius to understand its simplicity
-- Dennis Ritchie (1941-2011), Unix Co-Creator
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Am I being too C++ like? nroberts <roberts.noah@gmail.com> - 2012-01-18 13:53 -0800
Re: Am I being too C++ like? Shao Miller <sha0.miller@gmail.com> - 2012-01-18 18:50 -0500
Re: Am I being too C++ like? Nobody <nobody@nowhere.com> - 2012-01-19 04:13 +0000
Re: Am I being too C++ like? ImpalerCore <jadill33@gmail.com> - 2012-01-19 09:09 -0800
Re: Am I being too C++ like? Philip Lantz <prl@canterey.us> - 2012-01-18 21:42 -0800
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-19 12:30 +0000
Re: Am I being too C++ like? "BartC" <bc@freeuk.com> - 2012-01-19 15:17 +0000
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-19 18:44 -0800
Re: Am I being too C++ like? "BartC" <bc@freeuk.com> - 2012-01-20 13:44 +0000
Re: Am I being too C++ like? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-20 09:08 -0500
Re: Am I being too C++ like? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-20 07:58 -0800
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-20 11:25 -0800
Re: Am I being too C++ like? Kleuske <kleuske@nowhere.net> - 2012-01-20 20:17 +0000
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-01-21 09:23 +1300
Re: Am I being too C++ like? Kleuske <kleuske@nowhere.net> - 2012-01-20 22:00 +0000
Re: Am I being too C++ like? Stephen Sprunk <stephen@sprunk.org> - 2012-01-20 16:28 -0600
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-01-21 11:43 +1300
Re: Am I being too C++ like? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-20 18:02 -0500
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-20 16:12 -0800
Re: Am I being too C++ like? Kaz Kylheku <kaz@kylheku.com> - 2012-01-21 00:13 +0000
Re: Am I being too C++ like? William Ahern <william@wilbur.25thandClement.com> - 2012-01-20 17:37 -0800
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-20 22:25 -0800
Re: Am I being too C++ like? gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-21 16:07 +0000
Re: Am I being too C++ like? Bill Reid <hormelfree@gmail.com> - 2012-01-23 17:26 -0800
Re: Am I being too C++ like? Kaz Kylheku <kaz@kylheku.com> - 2012-01-21 18:00 +0000
Re: Am I being too C++ like? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-21 21:25 +0000
Re: Am I being too C++ like? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-02-11 23:46 +0200
Re: Am I being too C++ like? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-11 22:56 +0000
Re: Am I being too C++ like? Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-02-22 02:34 +0200
Re: Am I being too C++ like? Jens Gustedt <jens.gustedt@loria.fr> - 2012-01-21 22:42 +0100
Re: Am I being too C++ like? James Kuyper <jameskuyper@verizon.net> - 2012-01-21 21:22 -0500
Re: Am I being too C++ like? Jens Gustedt <jens.gustedt@loria.fr> - 2012-01-22 14:56 +0100
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-01-22 10:29 +1300
Re: Am I being too C++ like? Kleuske <kleuske@nowhere.net> - 2012-01-21 11:36 +0000
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-22 12:13 +0000
Re: Am I being too C++ like? Kleuske <kleuske@nowhere.net> - 2012-01-22 12:39 +0000
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-23 23:45 +0000
Re: Am I being too C++ like? Kleuske <kleuske@nowhere.net> - 2012-01-24 16:54 +0000
Re: Am I being too C++ like? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-01-22 04:43 -0800
Re: Am I being too C++ like? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-22 15:29 +0000
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-21 11:58 +0000
Re: Am I being too C++ like? Seebs <usenet-nospam@seebs.net> - 2012-01-21 21:32 +0000
Re: Am I being too C++ like? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-19 04:23 -0800
Re: Am I being too C++ like? Rui Maciel <rui.maciel@gmail.com> - 2012-01-19 14:39 +0000
Re: Am I being too C++ like? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-01-22 05:14 -0800
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-23 23:42 +0000
Re: Am I being too C++ like? Rui Maciel <rui.maciel@gmail.com> - 2012-01-19 14:51 +0000
Re: Am I being too C++ like? jgk@panix.com (Joe keane) - 2012-01-19 23:04 +0000
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-01-20 16:03 +1300
Re: Am I being too C++ like? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-20 06:01 -0800
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-01-21 08:03 +1300
Re: Am I being too C++ like? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-21 12:31 -0800
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-01-22 10:18 +1300
Re: Am I being too C++ like? cri@tiac.net (Richard Harter) - 2012-01-20 05:22 +0000
Re: Am I being too C++ like? Marco <prenom_nomus@yahoo.com> - 2012-01-21 07:29 -0800
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-24 12:13 +0000
Re: Am I being too C++ like? Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-31 14:32 -0800
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-31 15:32 -0800
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-31 19:46 -0800
Re: Am I being too C++ like? Shao Miller <sha0.miller@gmail.com> - 2012-01-31 23:54 -0500
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-01-31 22:24 -0800
Re: Am I being too C++ like? Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-31 23:28 -0800
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-02-01 11:23 -0800
Re: Am I being too C++ like? Stephen Sprunk <stephen@sprunk.org> - 2012-02-01 15:01 -0600
Re: Am I being too C++ like? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-02-01 14:09 -0800
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-02-01 14:44 -0800
Re: Am I being too C++ like? Shao Miller <sha0.miller@gmail.com> - 2012-02-01 17:36 -0500
Re: Am I being too C++ like? Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-08 12:45 -0800
Re: Am I being too C++ like? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-08 21:41 +0000
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-03-09 17:42 +1300
Re: Am I being too C++ like? Kaz Kylheku <kaz@kylheku.com> - 2012-03-09 08:12 +0000
Re: Am I being too C++ like? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-09 12:01 +0000
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-03-08 14:19 -0800
Re: Am I being too C++ like? Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-09 13:32 -0800
Re: Am I being too C++ like? nick_keighley_nospam@hotmail.com - 2012-03-09 04:18 -0800
Re: Am I being too C++ like? Ike Naar <ike@iceland.freeshell.org> - 2012-03-09 13:04 +0000
Re: Am I being too C++ like? Kaz Kylheku <kaz@kylheku.com> - 2012-03-10 01:02 +0000
Re: Am I being too C++ like? Ike Naar <ike@iceland.freeshell.org> - 2012-03-10 07:59 +0000
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-03-10 21:17 +1300
Re: Am I being too C++ like? nick_keighley_nospam@hotmail.com - 2012-03-10 02:39 -0800
Re: Am I being too C++ like? Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-09 13:51 -0800
Re: Am I being too C++ like? nick_keighley_nospam@hotmail.com - 2012-03-10 02:54 -0800
Re: Am I being too C++ like? Ian Collins <ian-news@hotmail.com> - 2012-03-10 12:27 +1300
Re: Am I being too C++ like? Rui Maciel <rui.maciel@gmail.com> - 2012-02-01 07:41 +0000
Re: Am I being too C++ like? Keith Thompson <kst-u@mib.org> - 2012-02-01 11:24 -0800
Re: Am I being too C++ like? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-01 21:55 +0000
csiph-web