I have one more doubt, regarding offsets.
In ECPGdump_a_simple() we have code
if (siz == NULL || strlen(siz) == 0 || strcmp(arrsize, "0") == 0 || strcmp(arrsize, "1") == 0)
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, offset);
else
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, siz);
If the caller has passed siz, it means that this variable is part of the a structure. Remember in dump_variables(), this function is called with struct_sizeof = NULL. So, once we know that siz != NULL and strlen(siz) != 0, it's evident that the simple variable we are dumping is part of a structure and hence we should be using "siz" instead of "offset". Why then we still check arrsize?