This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/9025: GNU C compiler does not honour 'const' type qualifier
- From: d dot petropoulos at encode-sec dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Dec 2002 15:01:21 -0000
- Subject: c/9025: GNU C compiler does not honour 'const' type qualifier
- Reply-to: d dot petropoulos at encode-sec dot com
>Number: 9025
>Category: c
>Synopsis: GNU C compiler does not honour 'const' type qualifier
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri Dec 20 07:06:30 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Dimitrios Petropoulos
>Release: multiple
>Organization:
>Environment:
* Solaris 8, sparc, GCC 3.1
* AIX 4.3, PowerPC, GCC 2.9-aix51-020209
* Linux, x86, GCC 2.96
>Description:
The gcc compiler (multiple versions and platforms) does not honour the 'const' type qualifier (it allows the program to modify a variable declared as const). Depending on the scope of the declaration the effect of this can range from overwriting the variable which has been declared as constant to segmentation fault of the program (with associated overwriting of registers). The attached file causes a segmentation fault and overwrites the instruction pointer on Linux or the r0 register on PowerPC.
>How-To-Repeat:
Just compile (no special flags/directive needed)
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: