Is char default-promoted?

First, default argument promotions 6.5.2.2 If the expression that denotes the called function has a type that does not include a prototype, the integer promotions are performed on each argument, and arguments that have type float are promoted to double. These are called the default argument promotions. Now for integer promotions: 6.3.1.1 The following may … Read more

Does the standard mandate an lvalue-to-rvalue conversion of the pointer variable when applying indirection?

I think you’re approaching this from a rather oblique angle, so to speak. According to §5.3.1/1: The unary * operator performs indirection: the expression to which it is applied shall be a pointer to an object type, or a pointer to a function type and the result is an lvalue referring to the object or … Read more

Is it safe to memset bool to 0?

Is it guaranteed by the law? No. C++ says nothing about the representation of bool values. Is it guaranteed by practical reality? Yes. I mean, if you wish to find a C++ implementation that does not represent boolean false as a sequence of zeroes, I shall wish you luck. Given that false must implicitly convert … Read more

Initialization vs Assignment in C

In the C Standard, only option (1) is initialization. In programming jargon, both may be considered initialization. Your question is really asking about the meanings of words. It’s normal for people to use words with various common meanings, instead of switching terminology for particular languages. Another example is “pass by reference”. Does C have pass … Read more