#49 simulation code not compileable

closed-remind
David Gay
5
2008-05-06
2008-05-03
Christoph Tornau
No

I use the new current CVS checkout of the nesC compiler which says that it's in version 1.3 alpha.

If I compile code for the simulation e.g. the Blink-application with "make micaz sim" the following error is outputed:

In file included from /usr/include/sys/types.h:373,
from /usr/include/sys/unistd.h:9,
from /usr/include/unistd.h:4,
from /opt/tinyos-2.x/tos/lib/tossim/tos.h:44:
/usr/include/cygwin/types.h:190: syntax error before `u_int64_t'
In file included from /opt/tinyos-2.x/tos/lib/tossim/tos.h:70:
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.h:60: syntax error before `event'
In file included from /opt/tinyos-2.x/tos/lib/tossim/tos.h:87:
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:42: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: In function `sim_queue_insert':
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:43: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:44: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: At top level:
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:66: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:66: conflicting types for `sim_queue_cleanup_none'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.h:65: previous declaration of `sim_queue_cleanup_none'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: In function `sim_queue_cleanup_none':
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:67: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: At top level:
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:71: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:71: conflicting types for `sim_queue_cleanup_event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.h:66: previous declaration of `sim_queue_cleanup_event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: In function `sim_queue_cleanup_event':
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:72: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:73: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: At top level:
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:76: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:76: conflicting types for `sim_queue_cleanup_data'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.h:67: previous declaration of `sim_queue_cleanup_data'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: In function `sim_queue_cleanup_data':
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:77: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:78: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: At top level:
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:82: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:82: conflicting types for `sim_queue_cleanup_total'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.h:68: previous declaration of `sim_queue_cleanup_total'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c: In function `sim_queue_cleanup_total':
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:83: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:84: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_event_queue.c:86: syntax error before `event'
In file included from /usr/include/time.h:140,
from /usr/include/sys/select.h:24,
from /usr/include/cygwin/sys_time.h:13,
from /usr/include/sys/time.h:27,
from /opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:39,
from /opt/tinyos-2.x/tos/lib/tossim/tos.h:88:
/usr/include/signal.h: At top level:
/usr/include/signal.h:21: syntax error before `signal'
In file included from /opt/tinyos-2.x/tos/lib/tossim/tos.h:88:
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:96:10: warning: integer constant is too large for its type
In file included from /opt/tinyos-2.x/tos/lib/tossim/tos.h:88:
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c: In function `sim_ticks_per_sec':
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:96: warning: integer constant out of range
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c: In function `sim_run_next_event':
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:110: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:111: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:112: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:116: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:117: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:121: syntax error before `event'
/opt/tinyos-2.x/tos/lib/tossim/sim_tossim.c:126: syntax error before `event'
In file included from /opt/tinyos-2.x/tos/lib/tossim/TinySchedulerC.nc:39:
In component `SimSchedulerBasicP':
/opt/tinyos-2.x/tos/lib/tossim/SimSchedulerBasicP.nc: In function `sim_scheduler_event_init':
/opt/tinyos-2.x/tos/lib/tossim/SimSchedulerBasicP.nc:100: warning: assignment from incompatible pointer type
In file included from /opt/tinyos-2.x/tos/lib/tossim/MainC.nc:49,
from BlinkAppC.nc:45:
In component `SimMoteP':
/opt/tinyos-2.x/tos/lib/tossim/SimMoteP.nc: In function `sim_mote_enqueue_boot_event':
/opt/tinyos-2.x/tos/lib/tossim/SimMoteP.nc:179: warning: assignment from incompatible pointer type
In file included from /opt/tinyos-2.x/tos/lib/tossim/MainC.nc:64,
from BlinkAppC.nc:45:
In component `TossimActiveMessageP':
/opt/tinyos-2.x/tos/lib/tossim/TossimActiveMessageP.nc: In function `allocate_deliver_event':
/opt/tinyos-2.x/tos/lib/tossim/TossimActiveMessageP.nc:243: warning: assignment from incompatible pointer type
In file included from /opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncC.nc:53,
from /opt/tinyos-2.x/tos/chips/atm128/timer/Atm128AlarmAsyncC.nc:33,
from /opt/tinyos-2.x/tos/platforms/mica/AlarmCounterMilliP.nc:33,
from /opt/tinyos-2.x/tos/platforms/mica/sim/HilTimerMilliC.nc:41,
from /opt/tinyos-2.x/tos/system/TimerMilliP.nc:41,
from /opt/tinyos-2.x/tos/system/TimerMilliC.nc:40,
from BlinkAppC.nc:46:
In component `HplAtm128Timer0AsyncP':
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc: In function `allocate_compare':
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc:219: warning: assignment from incompatible pointer type
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc: In function `allocate_overflow':
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc:496: warning: assignment from incompatible pointer type
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc: In function `cancel_overflow':
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc:541: warning: assignment from incompatible pointer type
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc: In function `cancel_compare':
/opt/tinyos-2.x/tos/chips/atm128/timer/sim/HplAtm128Timer0AsyncP.nc:573: warning: assignment from incompatible pointer type
make: *** [sim-exe] Error 1

If I compile the same program with nesc 1.2.9 for simulation everything is okay. Seems that changes must made to the TinyOS source tree or the compiler is broken.

Discussion

1 2 > >> (Page 1 of 2)
  • David Gay
    David Gay
    2008-05-05

    Logged In: YES
    user_id=398311
    Originator: NO

    This should be fixed now (latest CVS). Please reopen if there are still problems...

    David Gay

     
  • David Gay
    David Gay
    2008-05-05

    • status: open --> closed-fixed
     
  • compiliation error for simulation

     
    Attachments
    • status: closed-fixed --> open-fixed
     
  • Logged In: YES
    user_id=672026
    Originator: YES

    The fix doesn't work. The error becomes a different one. Please see the attached error.txt for details.

    Thank you very much for caring for the problem!
    File Added: error.txt

     
    • status: open-fixed --> open-remind
     
  • David Gay
    David Gay
    2008-05-06

    Logged In: YES
    user_id=398311
    Originator: NO

    Can you attach the generated build/micaz/app.c file?

     
  • app.c file which has been generated by nesc and fails compiling by gcc

     
    Attachments
  • Logged In: YES
    user_id=672026
    Originator: YES

    Please find the app.c file attached.

    Christoph
    File Added: app.c

     
  • David Gay
    David Gay
    2008-05-06

    Logged In: YES
    user_id=398311
    Originator: NO

    Can you attach the generated build/micaz/app.c file?

     
1 2 > >> (Page 1 of 2)