Top "Language-lawyer" questions

For questions about the intricacies of formal or authoritative specifications of programming languages and environments.

C++ multiple inheritance order

I'm trying to understand the affect of inheritance order in C++.. I looked online, but I couldn't find a clear …

c++ oop multiple-inheritance language-lawyer
What is behavior of NULL parameters to strstr?

What is the behavior when a NULL is passed as the parameters in strstr? Given: char * p = NULL; char * s = …

c language-lawyer strstr
Absolute value abs(x) using bitwise operators and Boolean logic

How does this work? The idea is to make abs(x) use bitwise operators for integers (assuming 32 bit words): y = …

c++ c bit-manipulation language-lawyer absolute-value
Is it legal to declare a constexpr initializer_list object?

As a question that came up during the discussion of this SO question: Is it legal, maybe with N3471, to …

c++ c++11 language-lawyer initializer-list constexpr
constexpr global constants in a header file and odr

Unfortunately, I am somewhat confused about constexpr, global constants declared in header files, and the odr. In short: Can we …

c++ c++11 language-lawyer constexpr linkage
How does this piece of code determine array size without using sizeof( )?

Going through some C interview questions, I've found a question stating "How to find the size of an array in …

c arrays size language-lawyer pointer-arithmetic
Is it legal for source code containing undefined behavior to crash the compiler?

Let's say I go to compile some poorly-written C++ source code that invokes undefined behavior, and therefore (as they say) "…

c++ language-lawyer undefined-behavior
Impossibly Fast C++ Delegates and different translation units

According to Sergey Ryazanov, his Impossibly Fast C++ Delegates are not comparable: My delegates cannot be compared. Comparison operators are …

c++ delegates language-lawyer one-definition-rule
What's the result of a & b?

This is awkward, but the bitwise AND operator is defined in the C++ standard as follows (emphasis mine). The usual …

c++ language-lawyer bitwise-operators
Is floating point addition commutative in C++?

For floating point values, is it guaranteed that a + b is the same as1 b + a? I believe this is …

c++ floating-point language-lawyer commutativity