Most restrictive type

  • Thread starter Vijay Kumar R Zanvar
  • Start date
V

Vijay Kumar R Zanvar

Ref: K&R section 8.7

..... so for a C99 complying implementation, if I've understood
correctly, the most restrictive type is long long?

Vijay
 
G

Gordon Burditt

Ref: K&R section 8.7
.... so for a C99 complying implementation, if I've understood
correctly, the most restrictive type is long long?

No, I don't think you're guaranteed that. It might be long double
or a pointer type. There are probably a lot of implementations
where double and long long are equally restrictive and the same
size, and long double is not more restrictive than double.

Gordon L. Burditt
 
R

Richard Bos

No, I don't think you're guaranteed that. It might be long double
or a pointer type. There are probably a lot of implementations
where double and long long are equally restrictive and the same
size, and long double is not more restrictive than double.

And I think the most restrictive integer type is intmax_t, which may be
larger and (AFAICT) more restrictive than long long. Though the word
"restrictive" does not occur in this sense in the Standard.

Richard
 
D

Dan Pop

In said:
Ref: K&R section 8.7

.... so for a C99 complying implementation, if I've understood
correctly, the most restrictive type is long long?

There is no way to tell. For a good guess, create an union containing
all integer types, all floating point types, a void pointer and a
function pointer and use it as the most restrictive type.

Of course, there is still the possibility that the most restrictive type
is an extended integer type, but this should not matter to portable code.

Dan
 
D

Dan Pop

In said:
And I think the most restrictive integer type is intmax_t, which may be
larger and (AFAICT) more restrictive than long long. Though the word
"restrictive" does not occur in this sense in the Standard.

What makes you think that intmax_t needs to be at least as restrictive
as long double or a pointer type?

Dan
 
G

Gordon Burditt

And I think the most restrictive integer type is intmax_t, which may be
^^^^^^^
What makes you think that intmax_t needs to be at least as restrictive
as long double or a pointer type?

long double and pointers are *INTEGER* types?

Gordon L. Burditt
 
D

Dan Pop

In said:
long double and pointers are *INTEGER* types?

You've snipped a bit too much. The OP didn't limit his question to
integer types, therefore it makes no sense to talk about the most
restrictive integer type.

Dan
 

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
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top