Re: coccinelle: ifaddr: Find address test in more complex conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 9 Jun 2022, Markus Elfring wrote:

> >>> How about trying an example?
> >> You might interpret the following test result as an expected one according to
> >> your understanding of implementation details.
> >>
> >> Markus_Elfring@Sonne:/home/altes_Heim2/elfring/Projekte/Coccinelle/Probe> spatch show_address_determination_in_checks-20220609.cocci initialisation_test2-20220609.c
> >> …
> >> @@ -1,8 +1,6 @@
> >>  void check(void)
> >>  {
> >>  int s = 1;
> >> -bool t = &s ? 0 : 1;
> >>  bool u;
> >> -u = &t ? 1 : 0;
> >>  }
>
>
> Can it be that special transformations (which are not represented as a parsing result
> from the application of named isomorphisms) were applied here?
>
>
>
> >> I observed that no questionable places were marked in the following source code.
> >>
> >>
> >> void check(void)
> >> {
> >> int s = 1;
> >> bool t = (&s);
> >> }
> >>
> >>
> >> Will this test case trigger further development considerations?
> > It seems to be doing what it should.
>
> I would expect that the usage of the address-of operator within extra parentheses
> should also be marked for reconsideration of such source code.

It's not a test expression.  The bool type is not relevant.

julia

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux