I have something like this in my code:
char *objects[] = {"_muldi3.o","_negdi2.o","_lshrdi3.o","_divdi3.o","_moddi3.o","_udivdi3.o"};
/* Around 127 strings stored above, listed only few here. */
char *divmod_objs[]={"_divdi3.o","_moddi3.o","_udivdi3.o"};
for (i=0;i<obj_count;i++)
{
if (objects[i]==divmod_objs[0])
break;
else
{
/* do something */
}
}
The if statement seems to give "Segmentation fault (core dumped)" so I might be doing something wrong. What is the right way to compare these strings?
obj_countis actually larger than the number of strings in the list