You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- 4This is so important! If the code that fixes the bug is somewhat counterintuitive, I'll often write a comment like "We need to foo the bar here, see bugtracker #1234". It doesn't make sense to copy all of the bug report into a code comment, but I do want to be able to understand the reason for that extra code in a year or 5.Guntram Blohm– Guntram Blohm2023-03-16 15:41:28 +00:00Commented Mar 16, 2023 at 15:41
- 1+1. Another variation is that a compiler will sometimes make an incorrect "optimization", so the transform gets disabled in cases that cannot be proven sound. Someone else notices the compiler isn't performing the optimization in cases where it would be useful and "fixes" it so it will perform the transform in those cases (but also in the erroneous ones).supercat– supercat2023-03-16 16:03:07 +00:00Commented Mar 16, 2023 at 16:03
- 2Hopefully, a test was implemented that ensures this bug is fixed, and after the audacious programmer simplifying the code removed the bugfix this test fails, before the newly faulty code goes into production and annoys the customers enough to file a bug report, or shuts the powerplant down.Peter - Reinstate Monica– Peter - Reinstate Monica2023-03-17 02:42:17 +00:00Commented Mar 17, 2023 at 2:42
- 2@supercat 98% of these cases are caused by buggy code and a programmer who insists they are never wrong and the compiler must be wrong.Stack Exchange Broke The Law– Stack Exchange Broke The Law2023-03-17 14:36:01 +00:00Commented Mar 17, 2023 at 14:36
- 1@supercat are you talking about this bug? gcc.gnu.org/bugzilla/show_bug.cgi?id=61502 there seems to be consensus that such pointers may compare equal but are not actually the same pointer; the comparison is not undefined behavior, but the outcome is unspecified (uncertain); the pointers are not the same, even if they compare equal, so dereferencing the one-past-the-end pointer is undefined behaviour. In fact two pointers may contain the exact same 1s and 0s and yet dereferencing one is undefined but not the other. If your code even cares about these dark corners of C, it's wrong.Stack Exchange Broke The Law– Stack Exchange Broke The Law2023-03-17 14:56:51 +00:00Commented Mar 17, 2023 at 14:56
| Show 8 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you