#860 "syntax error" compiling .h files; "Invalid Argument" error?

closed-rejected
nobody
None
5
2005-01-09
2005-01-09
No

I'm using SDCC to do an implementation of an 8051
target in MathWorks' Realtime Workshop. SDCC is
throwing an error when compiling the standard header
files that are used when generating code from a Simulink
model.

Here is the sdcc command and output, clipped from the
make output:

D:\RH8051_Testing\Models\trivial_test_rtw>sdcc --print-
search-dirs --verbose -V --dumpall --dumpraw --
dumptree --compile-only --model-large -I. -
DMICROCONTROLLER_8051 -DMODEL=trivial_test -DRT -
DNUMST=1 -DTID01EQ=0 -DNCSTATES=0 -DMT=0 -
DREAL_T=float trivial_test.c
programs:
C:\Program Files\SDCC\bin
datadir:
C:\Program Files\SDCC\bin\..
includedir:
C:\Program Files\SDCC\bin\..\include\mcs51
C:\Program Files\SDCC\bin\..\include
libdir:
C:\Program Files\SDCC\bin\..\lib
sdcc: Calling preprocessor...
+ C:\PROGRA~1\SDCC\bin\sdcpp.exe -nostdinc -Wall -
std=c99 -DSDCC=1 -I"." -DMICROCONTROLLER_8051 -
DMODEL=trivial_test -DRT -DNUMST=1 -DTID01EQ=0 -
DNCSTATES=0 -DMT=0 -DREAL_T=float -
DSDCC_MODEL_LARGE -DSDCC_mcs51 -D__mcs51 -
I"C:\Program Files\SDCC\bin\..\include\mcs51" -
I"C:\Program Files\SDCC\bin\..\include" "trivial_test.c"
sdcc: Generating code...
stdout: Invalid argument

simstruc.h:1083: syntax error: token -> ';' ; column 15

SDCC version:

SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51
/ds400/hc08 2.4.7 #921 (Jan 8 2005) (MINGW32)

I am attaching the preprocessor output rather than
numerous files. (I hope this is OK) I've looked through it
and can't find anything wrong.

Also, there is the "Invalid Argument" message that I
can't figure out. Is this coming from sdcc?

Thanks very much for any help that you could give.

Discussion

  • Raphael Neider

    Raphael Neider - 2005-01-09

    Logged In: YES
    user_id=1115835

    Actually there seems to be no SDCC bug here:

    simstruc.h:1083: void *data;
    "data" is a keyword in SDCC, you have to rename the variable.

    Although I did not get the "invalid argument" error there
    are further problems as the generated code is intended for
    32 bit architectures:

    trivial_test.c:148: (rtS)->sizes.checksums[0] = (4165278732U);
    will not work unless you specify (4165278732UL) making it a long
    integer literal (otherwise SDCC will crop it down to 16 bits).

    trivial_test.c:124: ...((sizeof(SimStruct)*10000 + 229));
    will also fail as N=sizeof(SimStruct) > 3, thus N*10000
    >=40000 which is not representable in a 16 bit in (as
    assumed by SDCC unless you use 10000L (or better 10000UL)
    instead).

    Hope that helps...

     
  • Richard T. Unruh

    • status: open --> closed-rejected
     

Log in to post a comment.