undefined-behavior
When is casting between pointer types not undefined behavior in C?
As a newcomer to C, I\'m confused about when casting a pointer is actually OK. As I understand, you can pretty much cast any pointer type to any other type, and the compiler will let you do it. For e[详细]
2023-02-07 10:19 分类:问答+= Operator Chaining (with a dash of UB)
开发者_JAVA技巧I understand there is no sequence point here before the semicolon, but is there a plausible explanation for the dereferenced pointer to use the old value 2 in the expression?[详细]
2023-02-06 17:03 分类:问答Is a union of structs sharing a first element undefined behavior?
SDL_Event is a union of an unsigned 8 bit type, and many structs whose first element is an unsigned 8 bit type. The reccomended usage is to access the Uint8 element of the union to determine what type[详细]
2023-02-03 17:00 分类:问答Behaviour and Order of evaluation in C# [duplicate]
This question already has answers here: 开发者_如何转开发 Closed 12 years ago. Possible Duplicate:[详细]
2023-02-03 04:00 分类:问答Undefined behavior and sequence points reloaded
Consider this topic a sequel of the following topic: Previous installment Undefined behavior and sequence points[详细]
2023-02-03 01:38 分类:问答Undefined behaviour with non-virtual destructors - is it a real-world issue?
Consider the following code: class A { public: A() {} ~A() {} }; class B: public A { B() {} ~B() {} }; A* b = new B;[详细]
2023-01-31 20:32 分类:问答What's the difference in undefined behavior between C++03 and C++11?
The new standard has different undefined behavior from the old one. The new sequencing rules, for example, mean that some arithmetic operations that use开发者_运维问答d to be undefined (for such reaso[详细]
2023-01-29 13:01 分类:问答Undefined behavior for intent(out) spliced array in fortran 90?
I am experiencing very weird behavior when I do this. I assume this is the origin of the issue, but I could be wrong. If any of you can confirm this is indeed undefined behavior, I would at least know[详细]
2023-01-28 14:33 分类:问答Deleting a pointer to an automatic variable [duplicate]
This question already has an answer here: W开发者_如何学运维hat is the behavior of "delete" with stack objects? [duplicate][详细]
2023-01-28 08:48 分类:问答Is returning a forward-declared structure undefined behavior?
I have the following code (include-guards omitted for simplicity\'s sake): = foo.hpp = struct FOO { int not_used_in_this_sample;[详细]
2023-01-27 08:40 分类:问答