This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove pre_expand_symtabs_matching quick_symbol_functions API
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> I find the following code appropriate in such cases:
Jan> while ((per_cu = dw2_symtab_iter_next (&iter)) != NULL)
Jan> {
Jan> }
->
Jan> for (;;)
Jan> {
Jan> per_cu = dw2_symtab_iter_next (&iter);
Jan> if (per_cu == NULL)
Jan> break;
Jan> }
Jan> Sorry for this nitpick.
Does anybody find the first version here objectionable?
FWIW I think it is clearer than the second.
I also noticed myself changing an iterator function to take an out
parameter to avoid assignment in a loop condition. This is another way
to get the same effect -- but it also obscures the code more than the
"plain C" style.
I propose that if there are no objections we allow the idiomatic
assignment in a loop header -- but nowhere else.
Tom