- for(remain=0; remain<strlen(SPEC_CVAL(val->etype).v_char)+1; remain++)
- pic16_emitDB(SPEC_CVAL(val->etype).v_char[ remain ], ptype, p);
-
- if((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) - 1)) > 0) {
- while(remain--) {
+ /* len is 0 if declartion equals initializer,
+ * >0 if declaration greater than initializer
+ * <0 if declaration less than initializer
+ * Strategy: if >0 emit 0x00 for the rest of the length,
+ * if <0 then emit only the length of declaration elements
+ * and warn user
+ */
+ len = DCL_ELEM (type) - (strlen (SPEC_CVAL (val->etype).v_char)+1);
+
+// fprintf(stderr, "%s:%d len = %i DCL_ELEM(type) = %i SPEC_CVAL-len = %i\n", __FILE__, __LINE__,
+// len, DCL_ELEM(type), strlen(SPEC_CVAL(val->etype).v_char));
+
+ remain=0;
+ if(len >= 0) {
+ for(remain=0; remain<strlen(SPEC_CVAL(val->etype).v_char)+1; remain++)
+ pic16_emitDB(SPEC_CVAL(val->etype).v_char[ remain ], ptype, p);
+
+ len -= remain;
+ while(len--) {