unsigned long long

J

Joe Wright

Dan said:
Try it yourself, with the compiler in conforming mode, this time!
Come on Dan, lighten up. As you have noted elsethread, we are not likely
to have C99 conformance. Vanilla gcc compiles this fine. With -ansi
-pedantic it complains about 'long long' of course. I've already
forgotten why I felt compelled to post code here.
 
P

Peter Nilsson

Or, more generally, to the actual type expected by the respective
conversion description.

Unless you're using a conforming C99 implementation, there is no
conversion description that is guarantee to properly handle a size_t
value. Even worse, in the case of sizeof(type) * CHAR_BIT, the type
of the expression can be either size_t or int.

....or unsigned int.
 
D

Dan Pop

In said:
Come on Dan, lighten up. As you have noted elsethread, we are not likely
to have C99 conformance. Vanilla gcc compiles this fine.

Vanilla gcc doesn't compile C, and this is NOT a gratuitously pedantic
remark.
With -ansi
-pedantic it complains about 'long long' of course. I've already
forgotten why I felt compelled to post code here.

Even with -std=c99 -pedantic your code fails to compile cleanly, because
of sizeof(void) which is nonsense in C: void is an incomplete type.

Dan
 
J

Joe Wright

Dan said:
In said:
Dan said:
Try this.
[ code snipped ]

Try it yourself, with the compiler in conforming mode, this time!
Come on Dan, lighten up. As you have noted elsethread, we are not likely
to have C99 conformance. Vanilla gcc compiles this fine.

Vanilla gcc doesn't compile C, and this is NOT a gratuitously pedantic
remark.
With -ansi
-pedantic it complains about 'long long' of course. I've already
forgotten why I felt compelled to post code here.

Even with -std=c99 -pedantic your code fails to compile cleanly, because
of sizeof(void) which is nonsense in C: void is an incomplete type.
You are completely right. I shouldn't ask you to lighten up on me. I
made at least four 'mistakes' in that code and you came down hard on two
of them. Thank you. I need to be more careful in what I write and what I
post.

I promise to be more careful in the future. Please keep trying to catch
me out.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,104
Messages
2,570,643
Members
47,247
Latest member
youngcoin

Latest Threads

Top