This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/9025: GNU C compiler does not honour 'const' type qualifier


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]