1. Funny compiling error (4.0b2, Open Watcom)

Hello guys, the following minimized code will report an error while compiling. Split the for loops at line [1] into 2 lines or comment the code at line [2] will make the error disappear:

public function pack(sequence s, integer m) 
return s 
end function 
 
public function unpack(sequence s, integer m) 
integer cha, ge = 5 
atom alen = 10 
for j=1 to alen do for j2=1 to ge-1 do cha = 1 end for end for -- [1] 
 
return s 
end function 
 
sequence seq 
seq = {} for j=1 to 1024 do seq &= rand(256)-1 end for 
? equal(seq, unpack(pack(seq, 256), 256)) -- [2] 

Console error message:

Translating code, pass: 1 2 3  generating 
Compiling with Watcom 
Compiling  12% init-.c 
Compiling  50% Noname1.c 
Noname1.c(57): Error! E1017: Label 'L4' already defined 
Couldn't compile file 'Noname1.c' 
Status: 8 Command: wcc386  /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s 
 /ID:\Root\App\Euphoria\4 Noname1.c 

new topic     » topic index » view message » categorize

2. Re: Funny compiling error (4.0b2, Open Watcom)

And here's Noname.c:

// Euphoria To C version 4.0.0 beta 2 (r2670) 
#include "include/euphoria.h" 
#include "main-.h" 
 
int _1unpack(int _s_148, int _m_149) 
{ 
    int _cha_150; 
    int _ge_151; 
    int _alen_153; 
    int _11 = 0; 
    int _10; 
    int _0, _1, _2; 
     
 
    /** integer cha, ge = 5*/ 
    _ge_151 = 5; 
 
    /** atom alen = 10*/ 
    _alen_153 = 10; 
 
    /** for j=1 to alen do for j2=1 to ge-1 do cha = 1 end for end for*/ 
    _10 = 10; 
    { 
        int _j_156; 
        _j_156 = 1; 
L1:  
        if (_j_156 > 10) 
        goto L2; // [20] 51 
R1: 
        _11 = _ge_151 - 1; 
        if ((long)((unsigned long)_11 +(unsigned long) HIGH_BITS) >= 0) 
        _11 = NewDouble((double)_11); 
        { 
            int _j2_159; 
            _j2_159 = 1; 
L3:  
            if (binary_op_a(GREATER, _j2_159, _11)) 
            goto L4; // [31] 46 
R3: 
            _cha_150 = 1; 
L5:  
            _0 = _j2_159; 
            if (IS_ATOM_INT(_j2_159)) { 
                _j2_159 = _j2_159 + 1; 
                if ((long)((unsigned long)_j2_159 +(unsigned long) HIGH_BITS) >= 0)  
                _j2_159 = NewDouble((double)_j2_159); 
            } 
            else { 
                _j2_159 = binary_op_a(PLUS, _j2_159, 1); 
            } 
            DeRef(_0); 
            goto L3; // [41] 38 
L4:  
            ; 
            DeRef(_j2_159); 
        } 
L4:  
        _j_156 = _j_156 + 1; 
        goto L1; // [46] 27 
L2:  
        ; 
    } 
 
    /** return s*/ 
    DeRef(_11); 
    _11 = NOVALUE; 
    return _s_148; 
    ; 
} 

new topic     » goto parent     » topic index » view message » categorize

3. Re: Funny compiling error (4.0b2, Open Watcom)

Nemo said...

Hello guys, the following minimized code will report an error while compiling. Split the for loops at line [1] into 2 lines or comment the code at line [2] will make the error disappear:

Could you please open a ticket for this issue?

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: Funny compiling error (4.0b2, Open Watcom)

Sure, so it is a bug.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Funny compiling error (4.0b2, Open Watcom)

Nemo said...

Sure, so it is a bug.

Definitely. I added a comment to the ticket. For now, make sure you don't put "end for"s on the same line. That might apply to "end while" statements, too.

Matt

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu