Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Markus Elfring
> Perhaps, but it will unnecessarily raise the running time of your semantic > patch. We come along different expectations again for the possible application of the construct “<+... … ...+>” for the semantic patch language. Should the concrete run time characteristics be clarified any more for

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Julia Lawall
On Tue, 4 Feb 2020, Markus Elfring wrote: > >> @replacement@ > >> constant c; > >> identifier text; > >> statement is, es; > >> @@ > >> <+... > > > > What is thhe point of the outer <+... ...+>? > > I would like to stress the possibility that source code adjustments > can be performed

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Markus Elfring
>> @replacement@ >> constant c; >> identifier text; >> statement is, es; >> @@ >> <+... > > What is thhe point of the outer <+... ...+>? I would like to stress the possibility that source code adjustments can be performed multiple times.

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Julia Lawall
On Tue, 4 Feb 2020, Markus Elfring wrote: > > The strcmp output has to be compared to zero strcmp(src_name, > > "equalizer_input_level") == 0. > > Would you like to let the following script for the semantic patch language > perform any changes in your source files automatically? > >

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Markus Elfring
> The strcmp output has to be compared to zero strcmp(src_name, > "equalizer_input_level") == 0. Would you like to let the following script for the semantic patch language perform any changes in your source files automatically? @replacement@ constant c; identifier text; statement is, es; @@

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Markus Elfring
>> @display@ >> expression X; >> identifier I; >> @@ >> *auto I = X(...); … > I think it expects a type as well. I don't know if that is a reasonable > assumption in C or in C++. How do you think about to interpret such a variable definition in the way that the omission of an other data type

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Markus Elfring
> If you are showing a patch, then the first column is empty, > except for the - and + characters. You are right. I am sorry for my misinterpretation of the “indentation” at this place. Regards, Markus ___ Cocci mailing list Cocci@systeme.lip6.fr

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Julia Lawall
On Tue, 4 Feb 2020, Markus Elfring wrote: > >> Do you distinguish between the storage class specifier > >> and other uses of such a key word? > >> https://en.cppreference.com/w/cpp/language/auto > > > > Sorry. I know nothing about C++. > > I guess that you know something also for this

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-04 Thread Markus Elfring
>> Do you distinguish between the storage class specifier >> and other uses of such a key word? >> https://en.cppreference.com/w/cpp/language/auto > > Sorry. I know nothing about C++. I guess that you know something also for this programming language according to the program option “--c++”.

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Julia Lawall
On Mon, 3 Feb 2020, Markus Elfring wrote: > > Where is the space that yoyu are concerned about? > > … > @@ -1,7 +1,7 @@ > void on_message_element … > ↑ > > How was this character added at the first column in this line > of my software test approach? I don't understand. If you are showing a

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Julia Lawall
On Mon, 3 Feb 2020, Markus Elfring wrote: > > Where is the space that yoyu are concerned about? > > … > @@ -1,7 +1,7 @@ > void on_message_element … > ↑ > > How was this character added at the first column in this line > of my software test approach? > > > >> > >>

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Markus Elfring
> Where is the space that yoyu are concerned about? … @@ -1,7 +1,7 @@ void on_message_element … ↑ How was this character added at the first column in this line of my software test approach? >> >>

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread wellington wallace
Hi! I did not have the time to look at this file. Lots of places comparing two chars indeed. The strcmp output has to be compared to zero strcmp(src_name, "equalizer_input_level") == 0. This is the result returned when the arguments are equal. Best Regards, Wellington. On Mon,

Re: [Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Julia Lawall
On Mon, 3 Feb 2020, Markus Elfring wrote: > Hello, > > I have tried the following small script variant out for > the semantic patch language. > > @replacement@ > constant c; > identifier text; > expression x; > statement is, es; > @@ > char* text = x(...); > > if ( > + strcmp( > text > +

[Cocci] Replacing a std::string check by strcmp() with SmPL

2020-02-03 Thread Markus Elfring
Hello, I have tried the following small script variant out for the semantic patch language. @replacement@ constant c; identifier text; expression x; statement is, es; @@ char* text = x(...); if ( + strcmp( text + , - == std::string( c ) ) is else es A corresponding