Tk Source Code

View Ticket
Login
Ticket UUID: 220747
Title: tkUnixDraw.c", line 97: first operand must have sca
Type: Bug Version: obsolete: 8.3.1
Submitter: welch Created on: 2000-10-31 23:50:45
Subsystem: 84. Unix Build Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2000-11-01 06:50:45
Resolution: Fixed Closed By: welch
    Closed on: 2000-10-31 23:50:45
Description:
OriginalBugID: 5819 Bug
Version: 8.3.1
SubmitDate: '2000-06-06'
LastModified: '2000-07-20'
Severity: LOW
Status: Released
Submitter: techsupp
ChangedBy: ericm
OS: Solaris
OSVersion: Solaris 2.8
Machine: Sun Ultra-2
FixedDate: '2000-07-20'
FixedInVersion: 8.4a2


Name:
Richard Paynter

Extensions:
n/a

CustomShell:
None

ReproducibleScript:
./configure --prefix=/usr/local --enable-64bit
make
Compiler: Forte c/c++ 6 from Sun

ObservedBehavior:
Error:

"/usr/share/src/tk8.3.1/unix/tkUnixDraw.c", line 97: first operand must have scalar type: op "?:"
cc: acomp failed for /usr/share/src/tk8.3.1/unix/tkUnixDraw.c
make: *** [tkUnixDraw.o] Error 2

Code:

    return XEmptyRegion((Region) damageRgn) ? 0 : 1;

If the code is changed to:

    if (XEmptyRegion((Region) damageRgn));
        return 1;
    else
        return 0;

I get these errors:

"/usr/share/src/tk8.3.1/unix/tkUnixDraw.c", line 97: operand cannot have void type: op "CBRANCH"
"/usr/share/src/tk8.3.1/unix/tkUnixDraw.c", line 97: controlling expressions must have scalar type
"/usr/share/src/tk8.3.1/unix/tkUnixDraw.c", line 99: syntax error before or at: else
"/usr/share/src/tk8.3.1/unix/tkUnixDraw.c", line 101: invalid directive
"/usr/share/src/tk8.3.1/unix/tkUnixDraw.c", line 102: cannot recover from previous errors
cc: acomp failed for /usr/share/src/tk8.3.1/unix/tkUnixDraw.c
make: *** [tkUnixDraw.o] Error 2

DesiredBehavior:
I expect a clean compile.



I think you got your bug report a little confused, but I think you are saying that there is a problem with your platform/compiler and the use of the trinary ( ? : ) operator indicated above.  I replaced it with an if/else as you suggested, which will hopefully fix the problem for you.  This fix is in the CVS repository now, and will go out with 8.4a2.  Thanks for finding the bug and suggesting the fix!

   Eric Melski                            The Other Tcl Guy
   ericm at ajubasolutions.com            Ajuba Solutions

-- 07/20/2000 ericm