Skip to contentSkip to conversation

Support for C++ delete expressions?

Cocci SF Markus Elfring 3 participants 5 messages Jun 3, 2018 – Jul 4, 2018 5 messages not in the archive

lore
Share & tools
lore
#1 lore raw
Quoted 6 lines · SF Markus Elfring

Hello,

The information ?make a small attempt to parse C++ files? is provided for the parameter ?--c++? of the program ?spatch?.
How does the software development situation look like for the handling of ?delete expressions??

Delete is handled. If there is some example for which the result is not satisfactory, you would have to provide it.

julia

Quoted 9 lines

http://en.cppreference.com/w/cpp/language/delete

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci at systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.20.1806032126430.2740@hadrien

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

[Cocci] Support for C++ delete expressions

delete [] is now supported by the C++ parser (ie with option --c++). Note that no C++ specific operators are supported by the semantic patch language.

julia

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

[Cocci] Support for C++ delete expressions

Quoted 8 lines · SF Markus Elfring
Quoted 1 line

delete [] is now supported by the C++ parser (ie with option --c++).

This is nice.

Quoted 2 lines

Note that no C++ specific operators are supported by the semantic patch language.

Quoted 8 lines

How will the software situation evolve further for corresponding key words?

Would you ever like to support a source code transformation where unnecessary null pointer checks can be removed before such delete statements?

Another description:
https://clang.llvm.org/extra/clang-tidy/checks/readability-delete-null-pointer.html

C++ is not a priority for me personally. If someone wants to fund adding better support for C++, that would probably be good for Coccinelle.

julia

Quoted 4 lines

Regards,
Markus

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

[Cocci] Checking evolution around software build parameters

SF Markus Elfring?:

Quoted 3 lines

/usr/bin/ocamlc.opt -c commons/proc_pidpath_stubs.c
gcc: error: unrecognized command line option ?-fstack-clash-protection?; did you mean ?-fstack-protector??

Thank you for reporting this. It seems that ocamlc assumes a version of GCC more recent than the version installed on your system.

In commit c619caf8 (github master), I removed the C stubs and replaced by pure OCaml implementations. The problem should have disappeared now.

Cheers,

Signature · 3 lines
Thierry.

SF Markus Elfring?:
Quoted 20 lines
Quoted 1 line

delete [] is now supported by the C++ parser (ie with option --c++).

Thanks for this software extension.

Now I am curious on collateral evolution around this information.

elfring at Sonne:~/Projekte/Coccinelle/20160205> git checkout master && git pull && ./autogen && ./configure && grep VERSION=1 Makefile.config && LANG=C make world ?
VERSION=1.0.6-00452-g175de16b
?
/usr/bin/ocamlc.opt -c commons/proc_pidpath_stubs.c
gcc: error: unrecognized command line option ?-fstack-clash-protection?; did you mean ?-fstack-protector??
make: *** [Makefile:633: commons/proc_pidpath_stubs.o] Error 2

Are there any special dependencies to consider for the usage of the software ?OCaml 4.05.0-5.1? (on my openSUSE development system)?

Regards,
Markus