On Mon, Sep 24, 2018 at 10:03 PM Michael Forney <mfor...@mforney.org> wrote: > On 7/8/18, Silvan Jegen <s.je...@gmail.com> wrote: > > Heyho > > > > Found this when running smatch on sbase. > > The current code is correct. -H should turn on gflags.h, and turn off > gflags.l. POSIX says each flag should override the other. I agree that > the current code is a little confusing.
Yes, you are right. Smatch and me got confused. In my case it was probably because I didn't know that assignments in C return the assigned value. > It would probably be clearer as > > case 'H': gflags.h = 1; gflags.l = 0; break; > case 'L': gflags.h = 0; gflags.l = 1; break; I also think this would be clearer and shorter. The current code is correct though so maybe it's not worth to send a patch. Thanks for having a look! Cheers, Silvan