From: Johan Knol <johan.knol@id...> - 2001-07-18 14:58:47
Array's in combination with type specifiers are extremely unreliable (see
Bernhard's bug #436360).
The problem is that whenever a pointer is checked against an array, only the
pointer type is checked. Ok, so do the check on ->next. That won't work
because you can have a CPOINTER pointing to S_FIXED int's and an ARRAY of
S_CODE int's. They are compatible, whereas an ARRAY of S_DATA int's isn't.
This would require extensive tests in compareType().
I am working on a scheme where the ARRAY declarator is skipped and the
num_elem member of the declarator structure implies an array. The
declarator could again point to a declarator with num_elem>1, thus implies a
multidimensional array. Now the specifiers oclass member of the pointer
specifier would be the storage class of the pointer (the array, that can now
be registered!) and it's specifiers sclass member would be the storage class
of the array data.
Prelimanairy tests solved bug #436360 (part 2), but revealed some problems
in the library (malloc.c and time.c) that went unnoticed so far, but didn't
really harm either.
I won't commit this yet, until 2.3.0 has been released.
I did commit a fix for the type-specifier of a type-def (bug #436360 (part
1)), but this should be harmless. If someone still finds a quark, don't
hesitate to comment out the "#define LAST_MINUTE_2_3_0_FIX" in SDCCsymt.c.
Get latest updates about Open Source Projects, Conferences and News.