Compile fails on improper use of const
Closed / Fixed218129ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:28
OriginalBugID: 1994 Bug
Version: 8.1
SubmitDate: '1999-05-05'
LastModified: '1999-12-03'
Severity: CRIT
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: Other
OSVersion: QNX 4.24
Machine: NA
FixedDate: '2000-10-25'
ClosedDate: '1999-12-03'
Name:
David Corlette
CVS:
tclBasic.c 1999/04/16
Comments:
I'll probably just comment out the define of CONST, but I'm not sure if
this is a good solution. So I thought I wouldn't pass on a diff, since
I'm not sure what's the best solution.
ReproducibleScript:
compile under QNX 4.24, after generic .configure step
ObservedBehavior:
Compile crashes with error:
/port/tcl/tcl8.1/unix/../generic/tclBasic.c(3406): Error! E1013:
Constant variable cannot be modified
DesiredBehavior:
I'm unclear why you are declaring objv as a const in tclInt.h, and then
attempting to modify objv in tclBasic.c (line 3406):
objv = localObjv;
As far as I know, you aren't supposed to modify consts! I do notice
that you are toying with const a bit, using CONST and defines, but it's
not clear to me why.
This is an error on the part of the compiler not understanding
how to handle const properly. The assignment is valid, as the
array is const, but not the pointer to it.
-- 12/03/1999 hobbs
welch Closed ticket [218129ffff].
[History diff]2000-10-26 08:15:55
dgp Ticket [218129ffff]: 3 changes
[History diff]2001-04-05 06:54:29
Log in (anonymous is fine) to add a comment.