Bug 91888
Summary: | Memory fail on properly compiled program | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Paul Osmialowski <newchief> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 9 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2003-05-29 11:26:41 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Paul Osmialowski
2003-05-29 11:09:52 UTC
Please read ISO C (e.g. ISO C99 6.4.5 says: "The multibyte character sequence is then used to initialize an array of static storage duration and length just sufficient to contain the sequence." and later on: "If the program attempts to modify such an array, the behavior is undefined." You can use -fwritable-strings to make string literals writable in gcc, but I'd strongly suggest you instead create a char array if you intend to modify it (-fwritable-string will be likely removed in the future). char logname[] = "logfile0.txt"; |