diff --git a/ChangeLog b/ChangeLog index 8ed31aa986dd26e58c89ad75c34a63212c4ae4e1..d6f4e773bf1d90ee30b077b3cdb048f94099ee5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ +0.9.2: 2004-Aug-24 + + * Indirect references in constraints resolver code fixed. + * Avoided compilation warning on gcc 3.3.3 systems. + 0.9.1: 2004-Aug-23 * Documentation updated: doc/asn1c-usage.pdf diff --git a/asn1c/tests/check-assembly.sh b/asn1c/tests/check-assembly.sh index 11571fc591a1bcd7a003f972c8dd1c2b3db87b6f..a0b0fdb1278374046195d094837e393b169a5004 100755 --- a/asn1c/tests/check-assembly.sh +++ b/asn1c/tests/check-assembly.sh @@ -43,26 +43,8 @@ CFLAGS=\${COMMON_FLAGS} ${CFLAGS} CXXFLAGS=\${COMMON_FLAGS} ${CXXFLAGS} all: check-executable -check-executable: compiled-module object-files - \$(CC) \$(CFLAGS) -o check-executable *.o - -# Cannot track dependencies automatically because files are not known beforehand -object-files: *.c* - @for sfile in *.c; do \\ - ofile=\`echo "\$\$sfile" | sed -e 's/\.c[c]*\$\$/.o/'\`; \\ - if [ "\$\$sfile" -nt "\$\$ofile" ]; then \\ - echo "\$(CC) \$(CFLAGS) -o \$\$ofile -c \$\$sfile"; \\ - \$(CC) \$(CFLAGS) -o \$\$ofile -c \$\$sfile; \\ - fi; \\ - done - @for sfile in *.cc; do \\ - ofile=\`echo "\$\$sfile" | sed -e 's/\.c[c]*\$\$/.o/'\`; \\ - if [ "\$\$sfile" -nt "\$\$ofile" ]; then \\ - echo "\$(CXX) \$(CXXFLAGS) -o \$\$ofile -c \$\$sfile";\\ - \$(CXX) \$(CXXFLAGS) -o \$\$ofile -c \$\$sfile; \\ - fi; \\ - done - @touch object-files +check-executable: compiled-module *.c* + \$(CC) \$(CFLAGS) -o check-executable *.c* # Compile the corresponding .asn1 spec. compiled-module: ${asn_module} ../../asn1c diff --git a/configure.in b/configure.in index 894756ad8b57fec1d80799ebcff0a2f4b2c69e9a..968bc2d9040316f58ae6e8b17e5a031c19358340 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ AC_INIT(libasn1parser/asn1p_y.y) AC_CANONICAL_BUILD AC_CANONICAL_TARGET AC_PREREQ(2.53) -AM_INIT_AUTOMAKE(asn1c, 0.9.1) +AM_INIT_AUTOMAKE(asn1c, 0.9.2) AC_SUBST(PATH) @@ -40,14 +40,14 @@ AM_PROG_LEX dnl *** Building mingw32 with cygwin compiler *** case "$host_os" in cygwin*) - CFLAGS="$CFLAGS -DWIN32" + dnl CFLAGS="$CFLAGS -DWIN32" case "$target" in *mingw*) CC="$CC -mno-cygwin" esac ;; mingw* | p32*) - CFLAGS="$CFLAGS -DWIN32" + dnl CFLAGS="$CFLAGS -DWIN32" ;; esac diff --git a/skeletons/BOOLEAN.c b/skeletons/BOOLEAN.c index da38772db64af76ccf39b0cfa976d6a00ea1800c..b0ae1786cb0c56255cccbbf8d3b48b02138873a4 100644 --- a/skeletons/BOOLEAN.c +++ b/skeletons/BOOLEAN.c @@ -61,7 +61,7 @@ BOOLEAN_decode_ber(asn1_TYPE_descriptor_t *td, ASN_DEBUG("Boolean length is %d bytes", (int)length); - (char *)buf_ptr += rval.consumed; + buf_ptr = ((char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c index 0c7a81afbcdc7a288c2b208cfcaaf5f3dfa709aa..16a6b74d6f80b8328d6c32720018c1f81fc3ef6f 100644 --- a/skeletons/INTEGER.c +++ b/skeletons/INTEGER.c @@ -67,7 +67,7 @@ INTEGER_decode_ber(asn1_TYPE_descriptor_t *td, /* * Make sure we have this length. */ - (char *)buf_ptr += rval.consumed; + buf_ptr = ((char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; diff --git a/skeletons/NativeInteger.c b/skeletons/NativeInteger.c index 759fe27e74a24276470f4e218522611894f0db61..b0cc3b71322f74dcb21a8987e7867e8c693f48be 100644 --- a/skeletons/NativeInteger.c +++ b/skeletons/NativeInteger.c @@ -74,7 +74,7 @@ NativeInteger_decode_ber(asn1_TYPE_descriptor_t *td, /* * Make sure we have this length. */ - (char *)buf_ptr += rval.consumed; + buf_ptr = ((char *)buf_ptr) + rval.consumed; size -= rval.consumed; if(length > (ber_tlv_len_t)size) { rval.code = RC_WMORE; diff --git a/skeletons/OBJECT_IDENTIFIER.c b/skeletons/OBJECT_IDENTIFIER.c index 4e6270dba6db8e5ae78ddfbaf305b463504074f1..fe209056d5898315a7f24edccd29b361e448583e 100644 --- a/skeletons/OBJECT_IDENTIFIER.c +++ b/skeletons/OBJECT_IDENTIFIER.c @@ -332,7 +332,7 @@ OBJECT_IDENTIFIER_get_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, *(unsigned char *)((char *)arcs + ((*(char *)&LE)?0:(arc_type_size - 1))) = first_arc; - (char *)arcs += arc_type_size; + arcs = ((char *)arcs) + arc_type_size; } /* Decode, if has space */ @@ -342,7 +342,7 @@ OBJECT_IDENTIFIER_get_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, arcs, arc_type_size)) return -1; startn = i + 1; - (char *)arcs += arc_type_size; + arcs = ((char *)arcs) + arc_type_size; add = 0; } num_arcs++; @@ -538,7 +538,7 @@ OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, unsigned int ar */ /* Copy the second (1'st) arcs[1] into the first_value */ *fv++ = 0; - (char *)arcs += arc_type_size; + arcs = ((char *)arcs) + arc_type_size; if(isLittleEndian) { uint8_t *aend = (unsigned char *)arcs - 1; uint8_t *a1 = (unsigned char *)arcs + arc_type_size - 1; @@ -567,8 +567,9 @@ OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, unsigned int ar /* * Save the rest of arcs. */ - for((char *)arcs += arc_type_size, i = 2; - i < arc_slots; i++, (char *)arcs += arc_type_size) { + for(arcs = ((char *)arcs) + arc_type_size, i = 2; + i < arc_slots; + i++, arcs = ((char *)arcs) + arc_type_size) { bp += OBJECT_IDENTIFIER_set_single_arc(bp, arcs, arc_type_size, 0); } diff --git a/skeletons/OCTET_STRING.c b/skeletons/OCTET_STRING.c index 8ea360d5f541221a3001b9b45db424ddd3e98b23..6e0e426df1319d224251d46e89c5dcb37b4f8e60 100644 --- a/skeletons/OCTET_STRING.c +++ b/skeletons/OCTET_STRING.c @@ -37,11 +37,11 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = { #define NEXT_PHASE(ctx) _CH_PHASE(ctx, +1) #define PREV_PHASE(ctx) _CH_PHASE(ctx, -1) -#define ADVANCE(num_bytes) do { \ - size_t num = num_bytes; \ - (char *)buf_ptr += num; \ - size -= num; \ - consumed_myself += num; \ +#define ADVANCE(num_bytes) do { \ + size_t num = num_bytes; \ + buf_ptr = ((char *)buf_ptr) + num; \ + size -= num; \ + consumed_myself += num; \ } while(0) #define RETURN(_code) do { \ diff --git a/skeletons/RELATIVE-OID.c b/skeletons/RELATIVE-OID.c index 3273ace5b6d8a1f0e541377105fc169e785a9a7b..252cc37390eb17facda449792773672071279984 100644 --- a/skeletons/RELATIVE-OID.c +++ b/skeletons/RELATIVE-OID.c @@ -87,7 +87,7 @@ RELATIVE_OID_get_arcs(RELATIVE_OID_t *roid, i - startn + 1, 0, arcs, arc_type_size)) return -1; - (char *)arcs += arc_type_size; + arcs = ((char *)arcs) + arc_type_size; num_arcs++; } @@ -122,7 +122,7 @@ RELATIVE_OID_set_arcs(RELATIVE_OID_t *roid, void *arcs, unsigned int arc_type_si /* * Encode the arcs. */ - for(i = 0; i < arcs_slots; i++, (char *)arcs += arc_type_size) { + for(i = 0; i < arcs_slots; i++, arcs = ((char *)arcs) + arc_type_size) { bp += OBJECT_IDENTIFIER_set_single_arc(bp, arcs, arc_type_size, 0); } diff --git a/skeletons/ber_decoder.c b/skeletons/ber_decoder.c index 0fd9b2623da432745a1b03b313da2205f71abdc4..e56cc6a6a4328dc6b9b729fa145d10a0d24e8914 100644 --- a/skeletons/ber_decoder.c +++ b/skeletons/ber_decoder.c @@ -7,7 +7,7 @@ #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ - (char *)ptr += num; \ + ptr = ((char *)ptr) + num; \ size -= num; \ consumed_myself += num; \ } while(0) diff --git a/skeletons/ber_tlv_length.c b/skeletons/ber_tlv_length.c index b3c1cebbb8c9fab0d2d70f801857134fed819b2e..508bc39ff21f0fbd5791df68678c93662124c947 100644 --- a/skeletons/ber_tlv_length.c +++ b/skeletons/ber_tlv_length.c @@ -87,7 +87,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) { * Indefinite length! */ ASN_DEBUG("Skipping indefinite length"); - for(skip = ll, (char *)ptr += ll, size -= ll;;) { + for(skip = ll, ptr = ((char *)ptr) + ll, size -= ll;;) { ber_tlv_tag_t tag; /* Fetch the tag */ @@ -95,7 +95,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) { if(tl <= 0) return tl; ll = ber_skip_length(BER_TLV_CONSTRUCTED(ptr), - (char *)ptr + tl, size - tl); + ((char *)ptr) + tl, size - tl); if(ll <= 0) return ll; skip += tl + ll; @@ -109,7 +109,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) { && ((uint8_t *)ptr)[1] == 0) return skip; - (char *)ptr += tl + ll; + ptr = ((char *)ptr) + tl + ll; size -= tl + ll; } diff --git a/skeletons/ber_tlv_tag.c b/skeletons/ber_tlv_tag.c index d69ba31b0290438a524026be2eac11445f704f8c..c0a0d6a670748d8d41baf2ddf617c5df2ed17ba8 100644 --- a/skeletons/ber_tlv_tag.c +++ b/skeletons/ber_tlv_tag.c @@ -30,8 +30,8 @@ ber_fetch_tag(void *ptr, size_t size, ber_tlv_tag_t *tag_r) { * Each octet contains 7 bits of useful information. * The MSB is 0 if it is the last octet of the tag. */ - for(val = 0, ((char *)ptr)++, skipped = 2; - skipped <= size; ((char *)ptr)++, skipped++) { + for(val = 0, ptr = ((char *)ptr) + 1, skipped = 2; + skipped <= size; ptr = ((char *)ptr) + 1, skipped++) { unsigned int oct = *(uint8_t *)ptr; if(oct & 0x80) { val = (val << 7) | (oct & 0x7F); diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c index 140e365d9fa06ae7323f8ae88d6e4d3987941520..cec0b8aad3dd2cf582afec0d9d5b167979e8070f 100644 --- a/skeletons/constr_CHOICE.c +++ b/skeletons/constr_CHOICE.c @@ -31,7 +31,7 @@ */ #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ - (char *)ptr += num; \ + ptr = ((char *)ptr) + num; \ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c index 87d5ab660bc5d983a542ea7083bfd2513d61e0a1..d1eb0297bbbeab32005ea993ee2322a5f9a12d2d 100644 --- a/skeletons/constr_SEQUENCE.c +++ b/skeletons/constr_SEQUENCE.c @@ -31,7 +31,7 @@ */ #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ - (char *)ptr += num; \ + ptr = ((char *)ptr) + num; \ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ diff --git a/skeletons/constr_SET.c b/skeletons/constr_SET.c index ba42a4ffa97f4f1372706f2ff8d6f94488420f3e..67816a773dc73bc3e207cd83a7c1ee603640a50b 100644 --- a/skeletons/constr_SET.c +++ b/skeletons/constr_SET.c @@ -37,7 +37,7 @@ */ #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ - (char *)ptr += num; \ + ptr = ((char *)ptr) + num; \ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \ diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c index e0c898da71882e0271491d4d1197f133df849250..d8dadf50e3790bb323dfde0efb4e5a9853c50d76 100644 --- a/skeletons/constr_SET_OF.c +++ b/skeletons/constr_SET_OF.c @@ -31,7 +31,7 @@ */ #define ADVANCE(num_bytes) do { \ size_t num = num_bytes; \ - (char *)ptr += num; \ + ptr = ((char *)ptr) + num; \ size -= num; \ if(ctx->left >= 0) \ ctx->left -= num; \