translation error

new topic     » topic index » view thread      » older message » newer message

Hello,

I've just tried to use Eub4 (r3379) on win32 system.
Use the interpreted version of my project is OK, so I've tried to compile my big euphoria project with the euc tool and i obtain this error :

Clib.c(15): Error! E1014: Left operand must be an 'lvalue' 
Clib.c(21): Error! E1014: Left operand must be an 'lvalue' 


The C source file Clib.c come from Clib.e and the function in error is make_word.

------------------------------------------------ 
global function make_word( integer lo, integer hi) 
------------------------------------------------ 
-- syntax: i = make_word( lo, hi ) 
-- description: 
--    make 2 bytes (8bit) into a word (16bit) 
 
   -- mask values ( copied from Derek Parnell's tk_math.e ) 
   lo  = and_bits( lo,  #FF ) 
   hi = and_bits( hi, #FF ) 
    
   return hi*#100 + lo 
end function 


I've done this test : make a small program which use the make_word function from Clib.e, translate it with euc tool. No compilation error. The executable is OK.

I've compare the two sources and found that :

In my project case, the make_word function in the produced source file lose the parameters to calculate the tu variable
In the test case, the produced source code seems to be OK and the program produce the good result.

BELOW the begining of the 2 Clic.c files produced by the euc process :

C source Clib.c from my big project begin by that code :

// Euphoria To C version 4.0.0 development (r3379) 
#include "include/euphoria.h" 
#include "main-.h" 
 
int _40make_word(int _lo_20237, int _hi_20238) 
{ 
    int _10768 = 0; 
    int _10767 = 0; 
    int _0, _1, _2; 
     
 
    /**    lo  = and_bits( lo,  #FF )*/ 
    {unsigned long tu; 
         tu = (unsigned long)2 & (unsigned long)255; 
         2 = MAKE_UINT(tu); 
    } 
 
    /**    hi = and_bits( hi, #FF )*/ 
    {unsigned long tu; 
         tu = (unsigned long)2 & (unsigned long)255; 
         2 = MAKE_UINT(tu); 
    } 
 
    /**    return hi*#100 + lo*/ 
    if (_hi_20238 == (short)_hi_20238) 
    _10767 = _hi_20238 * 256; 
    else 
    _10767 = NewDouble(_hi_20238 * (double)256); 
    if (IS_ATOM_INT(_10767)) { 
        _10768 = _10767 + _lo_20237; 
        if ((long)((unsigned long)_10768 + (unsigned long)HIGH_BITS) >= 0)  
        _10768 = NewDouble((double)_10768); 
    } 

C source Clib.c from my test begin by that code :

// Euphoria To C version 4.0.0 development (r3379) 
#include "include/euphoria.h" 
#include "main-.h" 
 
int _6make_word(int _lo_991, int _hi_992) 
{ 
    int _435 = 0; 
    int _434 = 0; 
    int _0, _1, _2; 
     
 
    /**    lo  = and_bits( lo,  #FF )*/ 
    {unsigned long tu; 
         tu = (unsigned long)_lo_991 & (unsigned long)255; 
         _lo_991 = MAKE_UINT(tu); 
    } 
 
    /**    hi = and_bits( hi, #FF )*/ 
    {unsigned long tu; 
         tu = (unsigned long)_hi_992 & (unsigned long)255; 
         _hi_992 = MAKE_UINT(tu); 
    } 
 
    /**    return hi*#100 + lo*/ 
    if (_hi_992 == (short)_hi_992) 
    _434 = _hi_992 * 256; 
    else 
    _434 = NewDouble(_hi_992 * (double)256); 
    if (IS_ATOM_INT(_434)) { 
        _435 = _434 + _lo_991; 
        if ((long)((unsigned long)_435 + (unsigned long)HIGH_BITS) >= 0)  
        _435 = NewDouble((double)_435); 
    } 

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu