Index: trunk/src/libcschem/abs_comp.c =================================================================== --- trunk/src/libcschem/abs_comp.c (revision 10202) +++ trunk/src/libcschem/abs_comp.c (revision 10203) @@ -105,6 +105,11 @@ csch_acomp_t *comp = calloc(sizeof(csch_acomp_t), 1); int short_name; + if (scope == CSCH_ASCOPE_SUBTREE_AUTO) { + rnd_message(RND_MSG_ERROR, "Can not find subtree-local component v/%s\n", name_loc); + return NULL; + } + /* create global comps with the short name; AUTO is taken GLOBAL: if we got here no other binding worked for it */ short_name = (scope == CSCH_ASCOPE_GLOBAL) || (scope == CSCH_ASCOPE_AUTO); @@ -129,9 +134,11 @@ case CSCH_ASCOPE_SUBTREE_LOCAL: case CSCH_ASCOPE_SHEET_LOCAL: - case CSCH_ASCOPE_SUBTREE_AUTO: htsp_set(&hlev->comps, comp->name_loc, comp); break; + + case CSCH_ASCOPE_SUBTREE_AUTO: + return NULL; /* can't get here */ } } Index: trunk/src/libcschem/abs_net.c =================================================================== --- trunk/src/libcschem/abs_net.c (revision 10202) +++ trunk/src/libcschem/abs_net.c (revision 10203) @@ -102,7 +102,13 @@ { csch_anet_t *net = calloc(sizeof(csch_anet_t), 1); int short_name; - + + if (scope == CSCH_ASCOPE_SUBTREE_AUTO) { + rnd_message(RND_MSG_ERROR, "Can not find subtree-local net v/%s\n", name_loc); + return NULL; + } + + /* create global nets with the short name; AUTO is taken GLOBAL: if we got here no other binding worked for it */ short_name = (scope == CSCH_ASCOPE_GLOBAL) || (scope == CSCH_ASCOPE_AUTO); @@ -124,9 +130,11 @@ case CSCH_ASCOPE_SUBTREE_LOCAL: case CSCH_ASCOPE_SHEET_LOCAL: - case CSCH_ASCOPE_SUBTREE_AUTO: htsp_set(&hlev->nets, net->name_loc, net); break; + + case CSCH_ASCOPE_SUBTREE_AUTO: + return NULL; /* can't get here */ } } net->scope = scope;