Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package coccinelle for openSUSE:Factory checked in at 2026-02-12 17:30:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/coccinelle (Old) and /work/SRC/openSUSE:Factory/.coccinelle.new.1977 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "coccinelle" Thu Feb 12 17:30:45 2026 rev:40 rq:1332719 version:1.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/coccinelle/coccinelle.changes 2025-11-26 17:15:47.555090889 +0100 +++ /work/SRC/openSUSE:Factory/.coccinelle.new.1977/coccinelle.changes 2026-02-12 17:30:52.868230735 +0100 @@ -1,0 +2,6 @@ +Mon Feb 2 02:02:02 UTC 2026 - [email protected] + +- Update to version 1.3.1 (b231de0db) + remove merged coccinelle.patch + +------------------------------------------------------------------- Old: ---- coccinelle.patch ----------(Old B)---------- Old:- Update to version 1.3.1 (b231de0db) remove merged coccinelle.patch ----------(Old E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ coccinelle.spec ++++++ --- /var/tmp/diff_new_pack.eIkc3I/_old 2026-02-12 17:30:53.612262307 +0100 +++ /var/tmp/diff_new_pack.eIkc3I/_new 2026-02-12 17:30:53.612262307 +0100 @@ -42,7 +42,6 @@ URL: http://coccinelle.lip6.fr/ Source0: %pkg-%version.tar.xz Source1: %pkg.rpmlintrc -Patch0: %pkg.patch %if "%build_flavor" == "" BuildRequires: autoconf BuildRequires: automake @@ -86,7 +85,6 @@ %prep %setup -q -n %pkg-%version -%patch -P 0 -p1 %build %if "%build_flavor" == "" ++++++ _service ++++++ --- /var/tmp/diff_new_pack.eIkc3I/_old 2026-02-12 17:30:53.676265023 +0100 +++ /var/tmp/diff_new_pack.eIkc3I/_new 2026-02-12 17:30:53.688265532 +0100 @@ -11,6 +11,7 @@ <param name="exclude">bundles/menhirLib</param> <param name="exclude">bundles/parmap</param> <param name="exclude">bundles/pcre</param> + <param name="exclude">bundles/pcre2</param> <param name="exclude">bundles/pyml</param> <param name="exclude">bundles/stdcompat</param> <param name="exclude">bundles</param> @@ -32,7 +33,7 @@ <param name="exclude">tools/distributed</param> <param name="exclude">tools/obsolete</param> <param name="filename">coccinelle</param> - <param name="revision">09b475bb3dd2b29c6bd904cc455d4c25c6641649</param> + <param name="revision">b231de0db3f9513f6ea936caea5428fe627af1b9</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://gitlab.inria.fr/coccinelle/coccinelle.git</param> ++++++ coccinelle-1.3.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/Makefile new/coccinelle-1.3.1/Makefile --- old/coccinelle-1.3.1/Makefile 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/Makefile 2026-01-20 15:51:07.000000000 +0100 @@ -34,7 +34,7 @@ SOURCES_parsing_cocci := \ flag_parsing_cocci.ml ast_cocci.ml ast0_cocci.ml \ pretty_print_cocci.ml visitor_ast0_types.ml \ - visitor_ast.ml visitor_ast0.ml ast0toast.ml unparse_ast0.ml \ + visitor_ast.ml visitor_ast0.ml strip_ast.ml ast0toast.ml unparse_ast0.ml \ unify_ast.ml compute_lines.ml iso_pattern.ml comm_assoc.ml \ iso_compile.ml single_statement.ml simple_assignments.ml \ get_metas.ml stmtlist.ml top_level.ml \ @@ -101,7 +101,7 @@ CORE_LIBS := unix str ocamlcommon \ $(STDCOMPATDIR)/stdcompat \ $(patsubst %,bytes,$(BYTESDIR)) \ - $(patsubst %,pcre,$(filter %/pcre.cma,$(LNKLIBS))) + $(patsubst %,pcre2,$(filter %/pcre2.cma,$(LNKLIBS))) ifeq ($(OCAMLATLEAST50),no) CORE_LIBS += bigarray @@ -121,7 +121,7 @@ LIBRARIES_spgen := $(CORE_LIBRARIES) -CORE_BUNDLES=stdcompat menhirLib pcre +CORE_BUNDLES=stdcompat menhirLib pcre2 ALL_BUNDLES=$(CORE_BUNDLES) parmap pyml @@ -214,7 +214,7 @@ $(addsuffix /menhirLib$(LIBSUFFIX),$(filter %/menhirLib,$(MAKELIBS))) PARMAP_LIB := $(addsuffix /parmap$(LIBSUFFIX),$(filter %/parmap,$(MAKELIBS))) PYML_LIB := $(addsuffix /pyml$(LIBSUFFIX),$(filter %/pyml,$(MAKELIBS))) -PCRE_LIB := $(addsuffix /pcre$(LIBSUFFIX),$(filter %/pcre,$(MAKELIBS))) +PCRE_LIB := $(addsuffix /pcre2$(LIBSUFFIX),$(filter %/pcre2,$(MAKELIBS))) STDCOMPAT_LIB := $(STDCOMPATDIR)/stdcompat$(LIBSUFFIX) STDCOMPAT_USERS := parsing_c/type_annoter_c cocci parsing_cocci/check_meta \ @@ -319,8 +319,8 @@ $(INSTALL_PROGRAM) bundles/pyml/dllpyml_stubs.so \ $(DESTDIR)$(LIBDIR); \ fi - if test -f bundles/pcre/dllpcre_stubs.so; then \ - $(INSTALL_PROGRAM) bundles/pcre/dllpcre_stubs.so \ + if test -f bundles/pcre2/dllpcre2_stubs.so; then \ + $(INSTALL_PROGRAM) bundles/pcre2/dllpcre2_stubs.so \ $(DESTDIR)$(LIBDIR); \ fi $(INSTALL_PROGRAM) spatch$(TOOLS_SUFFIX) $(DESTDIR)$(BINDIR)/spatch @@ -521,11 +521,11 @@ ifneq ($(PCRE_LIB),) ifeq ($(NATIVE),yes) $(PCRE_LIB): $(STDCOMPAT_LIB) - $(MAKE) -C bundles/pcre all - $(MAKE) -C bundles/pcre all.opt + $(MAKE) -C bundles/pcre2 all + $(MAKE) -C bundles/pcre2 all.opt else $(PCRE_LIB): $(STDCOMPAT_LIB) - $(MAKE) -C bundles/pcre all + $(MAKE) -C bundles/pcre2 all endif endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/Makefile.config.in new/coccinelle-1.3.1/Makefile.config.in --- old/coccinelle-1.3.1/Makefile.config.in 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/Makefile.config.in 2026-01-20 15:51:07.000000000 +0100 @@ -5,18 +5,18 @@ VERSION=@PACKAGE_VERSION@ # * for each library $1, add another entry in the same manner -MAKELIBS=@MAKE_dynlink@ @MAKE_menhirLib@ @MAKE_pyml@ @MAKE_pcre@ \ +MAKELIBS=@MAKE_dynlink@ @MAKE_menhirLib@ @MAKE_pyml@ @MAKE_pcre2@ \ @MAKE_parmap@ -LNKLIBS=@MODULES_dynlink@ @MODULES_menhirLib@ @MODULES_pcre@ @MODULES_pyml@ \ +LNKLIBS=@MODULES_dynlink@ @MODULES_menhirLib@ @MODULES_pcre2@ @MODULES_pyml@ \ @MODULES_parmap@ OPTLNKLIBS=@MODULESOPT_dynlink@ @MODULESOPT_menhirLib@ @MODULESOPT_pyml@ \ - @MODULESOPT_pcre@ @MODULESOPT_parmap@ -INCLIBS=@PATH_dynlink@ @PATH_menhirLib@ @PATH_pyml@ @PATH_pcre@ \ + @MODULESOPT_pcre2@ @MODULESOPT_parmap@ +INCLIBS=@PATH_dynlink@ @PATH_menhirLib@ @PATH_pyml@ @PATH_pcre2@ \ @PATH_parmap@ -FLAGSLIBS=@FLAGS_dynlink@ @FLAGS_menhirLib@ @FLAGS_pyml@ @FLAGS_pcre@ \ +FLAGSLIBS=@FLAGS_dynlink@ @FLAGS_menhirLib@ @FLAGS_pyml@ @FLAGS_pcre2@ \ @FLAGS_parmap@ OPTFLAGSLIBS=@OPTFLAGS_dynlink@ @OPTFLAGS_menhirLib@ @OPTFLAGS_pyml@ \ - @OPTFLAGS_pcre@ @OPTFLAGS_parmap@ + @OPTFLAGS_pcre2@ @OPTFLAGS_parmap@ # * end of library variables # system packages inc libs @@ -106,7 +106,7 @@ # selected libraries FEATURE_menhirLib=@FEATURE_menhirLib@ -FEATURE_pcre=@FEATURE_pcre@ +FEATURE_pcre=@FEATURE_pcre2@ # Features FEATURE_PYTHON=@FEATURE_PYTHON@ @@ -114,7 +114,7 @@ NO_OCAMLFIND=@SUBSTITUTED_OCAMLFIND@ # Include paths -PCREDIR=@PATH_pcre@ +PCREDIR=@PATH_pcre2@ PARMAPDIR=@PATH_parmap@ PYMLDIR=@PATH_pyml@ MENHIRDIR=@PATH_menhirLib@ @@ -129,4 +129,4 @@ MENHIR_FLAGS=@DEFAULT_MENHIR_FLAGS@ -OCAMLATLEAST50=@OCAMLATLEAST50@ \ No newline at end of file +OCAMLATLEAST50=@OCAMLATLEAST50@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/Makefile.libs new/coccinelle-1.3.1/Makefile.libs --- old/coccinelle-1.3.1/Makefile.libs 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/Makefile.libs 2026-01-20 15:51:07.000000000 +0100 @@ -36,15 +36,15 @@ # pcre library # Note: see the comment of the pycaml library about the double appearance of the stubs library. -LOCAL_pcre = $(BYTESDIR:=/bytes.cma) $(PCREDIR)/pcre.cma -LOCALOPT_pcre = $(BYTESDIR:=/bytes.cmxa) $(PCREDIR)/pcre.cmxa -GLOBAL_pcre = $(BYTESDIR:=/bytes.cma) $(PCREDIR)/pcre.cma -GLOBALOPT_pcre = $(BYTESDIR:=/bytes.cmxa) $(PCREDIR)/pcre.cmxa -FLAGS_pcre = \ - $(PCRE_LIBS:%=-ccopt %) -cclib -L$(PCREDIR) -dllib -lpcre_stubs \ - -cclib -lpcre_stubs -OPTFLAGS_pcre = \ - $(PCRE_LIBS:%=-ccopt %) -cclib -L$(PCREDIR) -cclib -lpcre_stubs +LOCAL_pcre2 = $(BYTESDIR:=/bytes.cma) $(PCREDIR)/pcre2.cma +LOCALOPT_pcre2 = $(BYTESDIR:=/bytes.cmxa) $(PCREDIR)/pcre2.cmxa +GLOBAL_pcre2 = $(BYTESDIR:=/bytes.cma) $(PCREDIR)/pcre2.cma +GLOBALOPT_pcre2 = $(BYTESDIR:=/bytes.cmxa) $(PCREDIR)/pcre2.cmxa +FLAGS_pcre2 = \ + $(PCRE_LIBS:%=-ccopt %) -cclib -L$(PCREDIR) -dllib -lpcre2_stubs \ + -cclib -lpcre2_stubs +OPTFLAGS_pcre2 = \ + $(PCRE_LIBS:%=-ccopt %) -cclib -L$(PCREDIR) -cclib -lpcre2_stubs # dynlink library LOCAL_dynlink = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/configure.ac new/coccinelle-1.3.1/configure.ac --- old/coccinelle-1.3.1/configure.ac 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/configure.ac 2026-01-20 15:51:07.000000000 +0100 @@ -144,7 +144,7 @@ dnl configured via AC_CHECK_COCCI_EXTPKG dnl or AC_REQ_COCCI_EXTPKG AC_COCCI_INIT_PKG_EMPTY([dynlink]) -AC_COCCI_INIT_PKG_EMPTY([pcre]) +AC_COCCI_INIT_PKG_EMPTY([pcre2]) AC_COCCI_INIT_PKG_EMPTY([bytes]) dnl for recent versions of pcre on old OCaml AC_COCCI_INIT_PKG_EMPTY([pyml]) AC_COCCI_INIT_PKG_EMPTY([stdcompat]) @@ -368,18 +368,18 @@ AC_ARG_ENABLE([pcre-syntax], AS_HELP_STRING([--enable-pcre-syntax], [enable pcre regular expression syntax (default: auto)])) AS_IF([test "x$enable_pcre_syntax" != "xno"], [dnl - PKG_CHECK_MODULES([PCRE], [libpcre],[AC_SUBST([HAVE_PCRE],[yes])],[AC_SUBST([HAVE_PCRE],[no])]) + PKG_CHECK_MODULES([PCRE], [libpcre2-8],[AC_SUBST([HAVE_PCRE],[yes])],[AC_SUBST([HAVE_PCRE],[no])]) AS_IF([test -z "$enable_pcre_syntax" -a "x$HAVE_PCRE" != xyes], [dnl AC_SUBST([enable_pcre_syntax], [no]) ], [dnl AS_IF([test "x$enable_pcre" = "xno"], [AC_SUBST([enable_pcre], [local])]) - AC_CHECK_COCCI_EXTPKG([pcre]) dnl will set $enable_pcre to 'yes', 'no', or 'local' + AC_CHECK_COCCI_EXTPKG([pcre2]) dnl will set $enable_pcre to 'yes', 'no', or 'local' AS_IF([test "x$enable_pcre" = "xyes"], [dnl AC_MSG_CHECKING([if pcre depends on bytes]) - AS_IF([test "x`$OCAMLFIND query -r -format '%p' pcre 2>/dev/null | grep bytes`" = "xbytes"], + AS_IF([test "x`$OCAMLFIND query -r -format '%p' pcre2 2>/dev/null | grep bytes`" = "xbytes"], [dnl AC_MSG_RESULT([yes]) AC_MSG_CHECKING([if bytes is an actual module]) @@ -406,14 +406,14 @@ AC_MSG_NOTICE([support for pcre syntax is enabled]) ], [dnl - AC_MSG_ERROR([the pcre feature is enabled but the pkg-config libpcre library is not found]) + AC_MSG_ERROR([the pcre feature is enabled but the pkg-config libpcre2-8 library is not found]) ]) AC_SUBST([REGEXP_MODULE], [Regexp_pcre]) AC_SUBST([REGEXP_FILE], [regexp_pcre.ml]) ], [dnl - AC_COCCI_INIT_PKG_EMPTY([pcre]) + AC_COCCI_INIT_PKG_EMPTY([pcre2]) AC_SUBST([REGEXP_MODULE], [Regexp_str]) AC_SUBST([REGEXP_FILE], [regexp_str.ml]) ]) @@ -570,7 +570,7 @@ AS_IF([test "$MAKE_parmap"], AC_CONFIG_SUBDIRS(bundles/parmap)) -AS_IF([test "$MAKE_pcre"], +AS_IF([test "$MAKE_pcre2"], [AS_IF([test "x$OCAMLATLEAST4030" = xno ], [AC_SUBST([CAMLnoreturn_start], []) AC_SUBST([CAMLnoreturn_end], [])], @@ -594,8 +594,8 @@ AC_SUBST([noalloc], [[[@@noalloc]]]) AC_SUBST([untagged], [[[@untagged]]])]) AC_CONFIG_FILES([ - bundles/pcre/pcre-ocaml/src/pcre.ml - bundles/pcre/pcre-ocaml/src/pcre_stubs.c + bundles/pcre2/pcre2-ocaml/lib/pcre2.ml + bundles/pcre2/pcre2-ocaml/lib/pcre2_stubs.c ])]) dnl @@ -632,7 +632,7 @@ pcre regexes: $enable_pcre_syntax (overridable with --enable-pcre-syntax) pcre module: $enable_pcre (for local package use --disable-pcre) -pcre library: $HAVE_PCRE (requires the libpcre-ocaml-dev package) +pcre library: $HAVE_PCRE (requires the libpcre2-ocaml-dev package) optimized spatch: $enable_opt (overridable with --disable-opt) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/extra/io.github.coccinelle.coccinelle.metainfo.xml new/coccinelle-1.3.1/extra/io.github.coccinelle.coccinelle.metainfo.xml --- old/coccinelle-1.3.1/extra/io.github.coccinelle.coccinelle.metainfo.xml 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/extra/io.github.coccinelle.coccinelle.metainfo.xml 2026-01-20 15:51:07.000000000 +0100 @@ -13,7 +13,7 @@ <p>Coccinelle is a program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code. Coccinelle was initially targeted towards performing collateral evolutions in Linux. Such evolutions comprise the changes that are needed in client code in response to evolutions in library APIs, and may include modifications such as renaming a function, adding a function argument whose value is somehow context-dependent, and reorganizing a data structure. Beyond collateral evolutions, Coccinelle is successfully used (by us and others) for finding and fixing bugs in systems code.</p> </description> <releases> - <release version="1.3.1" date="2024-11-12" type="stable"/> + <release version="1.3.1" date="2025-11-18" type="stable"/> </releases> <url type="homepage">https://coccinelle.gitlabpages.inria.fr/website/</url> <url type="contact">https://sympa.inria.fr/sympa/info/cocci</url> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/globals/regexp_pcre.ml new/coccinelle-1.3.1/globals/regexp_pcre.ml --- old/coccinelle-1.3.1/globals/regexp_pcre.ml 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/globals/regexp_pcre.ml 2026-01-20 15:51:07.000000000 +0100 @@ -5,7 +5,7 @@ *) type regexp = - Pcre of int (* Pcre.regexp *) + Pcre of int (* Pcre2.regexp *) | Str of Str.regexp (* A table is used because PCRE regular expressions are not comparable. @@ -26,7 +26,7 @@ begin let c = !pcre_ctr in pcre_ctr := !pcre_ctr + 1; - Hashtbl.add pcre_table c (Pcre.regexp string); + Hashtbl.add pcre_table c (Pcre2.regexp string); Pcre c end else Str (Str.regexp string) @@ -35,7 +35,7 @@ match regexp with Pcre regexp -> let regexp = Hashtbl.find pcre_table regexp in - Pcre.pmatch ~rex:regexp string + Pcre2.pmatch ~rex:regexp string | Str regexp -> try ignore(Str.search_forward regexp string 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/parsing_c/parser_c.mly new/coccinelle-1.3.1/parsing_c/parser_c.mly --- old/coccinelle-1.3.1/parsing_c/parser_c.mly 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/parsing_c/parser_c.mly 2026-01-20 15:51:07.000000000 +0100 @@ -477,7 +477,7 @@ | params -> params +> List.iter (function | ({p_namei= Some name}, _) -> - LP.add_ident (Ast_c.str_of_name s) + LP.add_ident (Ast_c.str_of_name name) | _ -> () (* failwith "internal error: fixOldCDecl not good" *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/parsing_cocci/disjdistr.ml new/coccinelle-1.3.1/parsing_cocci/disjdistr.ml --- old/coccinelle-1.3.1/parsing_cocci/disjdistr.ml 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/parsing_cocci/disjdistr.ml 2026-01-20 15:51:07.000000000 +0100 @@ -6,46 +6,73 @@ module Ast = Ast_cocci module V = Visitor_ast +module S = Strip_ast -let disjmult2 e1 e2 k = - List.concat - (List.map (function e1 -> List.map (function e2 -> k e1 e2) e2) e1) - -let disjmult3 e1 e2 e3 k = - List.concat - (List.map - (function e1 -> - List.concat - (List.map - (function e2 -> List.map (function e3 -> k e1 e2 e3) e3) - e2)) - e1) - -let disjmult4 e1 e2 e3 e4 k = - List.concat - (List.map - (function e1 -> - List.concat - (List.map - (function e2 -> - List.concat - (List.map - (function e3 -> List.map (function e4 -> k e1 e2 e3 e4) e4) - e3)) - e2)) - e1) +let disjmult2 strip e1 e2 k = + List.rev + (fst + (List.fold_left + (fun (prev,seen) e1 -> + List.fold_left + (fun (prev,seen) e2 -> + let cur = k e1 e2 in + let scur = strip cur in + if List.mem scur seen + then (prev,seen) + else (cur :: prev, scur::seen)) + (prev,seen) e2) + ([],[]) e1)) + +let disjmult3 strip e1 e2 e3 k = + List.rev + (fst + (List.fold_left + (fun (prev,seen) e1 -> + List.fold_left + (fun (prev,seen) e2 -> + List.fold_left + (fun (prev,seen) e3 -> + let cur = k e1 e2 e3 in + let scur = strip cur in + if List.mem scur seen + then (prev,seen) + else (cur :: prev, scur::seen)) + (prev,seen) e3) + (prev,seen) e2) + ([],[]) e1)) + +let disjmult4 strip e1 e2 e3 e4 k = + List.rev + (fst + (List.fold_left + (fun (prev,seen) e1 -> + List.fold_left + (fun (prev,seen) e2 -> + List.fold_left + (fun (prev,seen) e3 -> + List.fold_left + (fun (prev,seen) e4 -> + let cur = k e1 e2 e3 e4 in + let scur = strip cur in + if List.mem scur seen + then (prev,seen) + else (cur :: prev, scur::seen)) + (prev,seen) e4) + (prev,seen) e3) + (prev,seen) e2) + ([],[]) e1)) let rec disjmult f = function [] -> [[]] | x::xs -> let cur = f x in let rest = disjmult f xs in - disjmult2 cur rest (function cur -> function rest -> cur :: rest) + disjmult2 (fun x -> x) cur rest (function cur -> function rest -> cur :: rest) let disjtwoelems fstart frest (start,rest) = let cur = fstart start in let rest = frest rest in - disjmult2 cur rest (function cur -> function rest -> (cur,rest)) + disjmult2 (fun x -> x) cur rest (function cur -> function rest -> (cur,rest)) let disjoption f = function None -> [None] @@ -54,6 +81,20 @@ let disjdots f d = List.map (function l -> Ast.rewrap d l) (disjmult f (Ast.unwrap d)) +let flatconcat strip l = + List.rev + (fst + (List.fold_left + (fun (prev,seen) curl -> + List.fold_left + (fun (prev,seen) cur -> + let scur = strip cur in + if List.mem scur seen + then (prev,seen) + else (cur::prev, scur::seen)) + (prev,seen) curl) + ([],[]) l)) + let rec disjty ft = match Ast.unwrap ft with Ast.Type(allminus,cvbefore,ty,cvafter) -> @@ -64,9 +105,9 @@ | Ast.AsType(ty,asty) -> (* as ty doesn't contain disj *) let ty = disjty ty in List.map (function ty -> Ast.rewrap ft (Ast.AsType(ty,asty))) ty - | Ast.DisjType(types) -> List.concat (List.map disjty types) + | Ast.DisjType(types) -> flatconcat S.strip_fullType (List.map disjty types) | Ast.ConjType(types) -> - let types = disjmult disjty types in + let types = disjmult disjty types in List.map (function types -> Ast.rewrap ft (Ast.ConjType(types))) types | Ast.OptType(ty) -> let ty = disjty ty in @@ -89,11 +130,11 @@ (function ty -> Ast.rewrap bty (Ast.FunctionType(ty,lp,params,rp))) ty | Ast.Array(ty,lb,size,rb) -> - disjmult2 (disjty ty) (disjoption disjexp size) + disjmult2 S.strip_typeC (disjty ty) (disjoption disjexp size) (function ty -> function size -> Ast.rewrap bty (Ast.Array(ty,lb,size,rb))) | Ast.Decimal(dec,lp,length,comma,precision_opt,rp) -> - disjmult2 (disjexp length) (disjoption disjexp precision_opt) + disjmult2 S.strip_typeC (disjexp length) (disjoption disjexp precision_opt) (function length -> function precision_opt -> Ast.rewrap bty (Ast.Decimal(dec,lp,length,comma,precision_opt,rp))) | Ast.EnumName(enum,key,name) -> @@ -108,7 +149,7 @@ let name = disjident name in List.map (function name -> Ast.rewrap bty (Ast.TypeName(typename,name))) name | Ast.EnumDef(ty,base,lb,ids,rb) -> - disjmult3 (disjty ty) + disjmult3 S.strip_typeC (disjty ty) (disjoption (function (td, ty1) -> let ty1 = disjty ty1 in @@ -118,7 +159,7 @@ (fun ty base ids -> Ast.rewrap bty (Ast.EnumDef(ty,base,lb,ids,rb))) | Ast.StructUnionDef(ty,lb,decls,rb) -> - disjmult2 (disjty ty) (disjdots anndisjfield decls) + disjmult2 S.strip_typeC (disjty ty) (disjdots anndisjfield decls) (function ty -> function decls -> Ast.rewrap bty (Ast.StructUnionDef(ty,lb,decls,rb))) | Ast.TypeOfExpr(tf,lp,exp,rp) -> @@ -130,11 +171,11 @@ List.map (function ty -> Ast.rewrap bty (Ast.TypeOfType(tf,lp,ty,rp))) ty | Ast.TemplateType(tn,lp,args,rp) -> - disjmult2 (disjty tn) (disjdots disjexp args) + disjmult2 S.strip_typeC (disjty tn) (disjdots disjexp args) (fun tn args -> Ast.rewrap bty (Ast.TemplateType(tn,lp,args,rp))) | Ast.QualifiedType(ty,coloncolon,name) -> - disjmult2 (disjoption disjty ty) (disjident name) + disjmult2 S.strip_typeC (disjoption disjty ty) (disjident name) (function ty -> function name -> Ast.rewrap bty (Ast.QualifiedType(ty,coloncolon,name))) | Ast.NamedType(_) | Ast.AutoType(_) | Ast.MetaType(_,_,_,_) -> [bty] @@ -152,7 +193,7 @@ (function decl -> Ast.rewrap d (Ast.FElem(bef,allminus,decl))) (disjfield decls) | Ast.Fdots(_,_) -> [d] - | Ast.DisjField(decls) -> List.concat (List.map anndisjfield decls) + | Ast.DisjField(decls) -> flatconcat S.strip_ann_field (List.map anndisjfield decls) | Ast.ConjField(decl_list) -> let decl_list = disjmult anndisjfield decl_list in List.map (function decl_list -> Ast.rewrap d (Ast.ConjField(decl_list))) @@ -170,7 +211,7 @@ List.map (function name -> Ast.rewrap d (Ast.Enum(name,None))) name | Some (eq,eval) -> - disjmult2 name (disjexp eval) + disjmult2 S.strip_enumdecl name (disjexp eval) (function name -> function eval -> Ast.rewrap d (Ast.Enum(name,Some(eq,eval))))) | Ast.EnumComma(cm) -> [d] @@ -178,7 +219,7 @@ and disjident e = match Ast.unwrap e with - Ast.DisjId(id_list) -> List.concat (List.map disjident id_list) + Ast.DisjId(id_list) -> flatconcat S.strip_ident (List.map disjident id_list) | Ast.ConjId(id_list) -> let id_list = disjmult disjident id_list in List.map (function id_list -> Ast.rewrap e (Ast.ConjId(id_list))) @@ -193,15 +234,15 @@ Ast.Ident(_) | Ast.Constant _ | Ast.StringConstant _ -> [e] (* even Ident can't contain disj, nor StringConstant *) | Ast.FunCall(fn,lp,args,rp) -> - disjmult2 (disjexp fn) (disjdots disjexp args) + disjmult2 S.strip_expression (disjexp fn) (disjdots disjexp args) (function fn -> function args -> Ast.rewrap e (Ast.FunCall(fn,lp,args,rp))) | Ast.Assignment(left,op,right,simple) -> - disjmult2 (disjexp left) (disjexp right) + disjmult2 S.strip_expression (disjexp left) (disjexp right) (function left -> function right -> Ast.rewrap e (Ast.Assignment(left,op,right,simple))) | Ast.Sequence(left,op,right) -> - disjmult2 (disjexp left) (disjexp right) + disjmult2 S.strip_expression (disjexp left) (disjexp right) (function left -> function right -> Ast.rewrap e (Ast.Sequence(left,op,right))) | Ast.CondExpr(exp1,why,Some exp2,colon,exp3) -> @@ -213,7 +254,7 @@ | _ -> failwith "not possible") res | Ast.CondExpr(exp1,why,None,colon,exp3) -> - disjmult2 (disjexp exp1) (disjexp exp3) + disjmult2 S.strip_expression (disjexp exp1) (disjexp exp3) (function exp1 -> function exp3 -> Ast.rewrap e (Ast.CondExpr(exp1,why,None,colon,exp3))) | Ast.Postfix(exp,op) -> @@ -226,7 +267,7 @@ let exp = disjexp exp in List.map (function exp -> Ast.rewrap e (Ast.Unary(exp,op))) exp | Ast.Binary(left,op,right) -> - disjmult2 (disjexp left) (disjexp right) + disjmult2 S.strip_expression (disjexp left) (disjexp right) (function left -> function right -> Ast.rewrap e (Ast.Binary(left,op,right))) | Ast.Nested(exp,op,right) -> @@ -237,23 +278,23 @@ let exp = disjexp exp in List.map (function exp -> Ast.rewrap e (Ast.Paren(lp,exp,rp))) exp | Ast.ArrayAccess(fn,lb,args,rb) -> - disjmult2 (disjexp fn) (disjdots disjexp args) + disjmult2 S.strip_expression (disjexp fn) (disjdots disjexp args) (function fn -> function args -> Ast.rewrap e (Ast.ArrayAccess(fn,lb,args,rb))) | Ast.RecordAccess(exp,pt,field) -> - disjmult2 (disjexp exp) (disjident field) + disjmult2 S.strip_expression (disjexp exp) (disjident field) (fun exp field -> Ast.rewrap e (Ast.RecordAccess(exp,pt,field))) | Ast.RecordPtAccess(exp,ar,field) -> - disjmult2 (disjexp exp) (disjident field) + disjmult2 S.strip_expression (disjexp exp) (disjident field) (fun exp field -> Ast.rewrap e (Ast.RecordPtAccess(exp,ar,field))) | Ast.QualifiedAccess(Some ty,coloncolon,field) -> - disjmult2 (disjty ty) (disjident field) + disjmult2 S.strip_expression (disjty ty) (disjident field) (fun ty field -> Ast.rewrap e (Ast.QualifiedAccess(Some ty,coloncolon,field))) | Ast.QualifiedAccess(None,coloncolon,field) -> let field = disjident field in List.map (function field -> Ast.rewrap e (Ast.QualifiedAccess(None,coloncolon,field))) field | Ast.Cast(lp,ty,rp,exp) -> - disjmult2 (disjty ty) (disjexp exp) + disjmult2 S.strip_expression (disjty ty) (disjexp exp) (function ty -> function exp -> Ast.rewrap e (Ast.Cast(lp,ty,rp,exp))) | Ast.SizeOfExpr(szf,exp) -> @@ -273,11 +314,11 @@ let exp = disjexp exp in List.map (function exp -> Ast.rewrap e (Ast.DeleteArr(dlt,lb,rb,exp))) exp | Ast.New(nw,pp_opt,lp_opt,ty,rp_opt,args_opt) -> - disjmult3 (disjoption disjargs pp_opt) (disjty ty) (disjoption disjargs args_opt) + disjmult3 S.strip_expression (disjoption disjargs pp_opt) (disjty ty) (disjoption disjargs args_opt) (fun pp_opt ty args_opt -> Ast.rewrap e (Ast.New(nw,pp_opt,lp_opt,ty,rp_opt,args_opt))) | Ast.TemplateInst(tn,lp,args,rp) -> - disjmult2 (disjexp tn) (disjdots disjexp args) + disjmult2 S.strip_expression (disjexp tn) (disjdots disjexp args) (fun tn args -> Ast.rewrap e (Ast.TemplateInst(tn,lp,args,rp))) | Ast.TupleExpr(init) -> @@ -288,7 +329,7 @@ let ty = disjty ty in List.map (function ty -> Ast.rewrap e (Ast.TypeExp(ty))) ty | Ast.Constructor(lp,ty,rp,init) -> - disjmult2 (disjty ty) (disjini init) + disjmult2 S.strip_expression (disjty ty) (disjini init) (function ty -> function exp -> Ast.rewrap e (Ast.Constructor(lp,ty,rp,init))) | Ast.MetaErr(_,_,_,_) | Ast.MetaExpr(_,_,_,_,_,_,_) @@ -299,7 +340,9 @@ | Ast.AsSExpr(exp,asstm) -> (* as exp doesn't contain disj *) let exp = disjexp exp in List.map (function exp -> Ast.rewrap e (Ast.AsSExpr(exp,asstm))) exp - | Ast.DisjExpr(exp_list) -> List.concat (List.map disjexp exp_list) + | Ast.DisjExpr(exp_list) -> + let el = List.map disjexp exp_list in + flatconcat S.strip_expression el | Ast.ConjExpr(exp_list) -> let exp_list = disjmult disjexp exp_list in List.map (function exp_list -> Ast.rewrap e (Ast.ConjExpr(exp_list))) @@ -319,7 +362,7 @@ and disjparam p = match Ast.unwrap p with Ast.Param(ty,id,attr) -> - disjmult2 (disjty ty) (disjoption disjident id) + disjmult2 S.strip_parameter (disjty ty) (disjoption disjident id) (fun ty id -> Ast.rewrap p (Ast.Param(ty,id,attr))) | Ast.AsParam(pm,asexp) -> (* as exp doesn't contain disj *) let pm = disjparam pm in @@ -333,7 +376,7 @@ and disjtemplateparam p = match Ast.unwrap p with Ast.TypenameOrClassParam(tyorcl,id,Some(eq,ty)) -> - disjmult2 (disjident id) (disjty ty) + disjmult2 S.strip_template_parameter (disjident id) (disjty ty) (fun id ty -> Ast.rewrap p (Ast.TypenameOrClassParam(tyorcl,id,Some(eq,ty)))) | Ast.TypenameOrClassParam(tyorcl,id,None) -> @@ -342,10 +385,10 @@ (fun id -> Ast.rewrap p (Ast.TypenameOrClassParam(tyorcl,id,None))) id | Ast.VarNameParam(ty,id,Some (eq,ini)) -> - disjmult3 (disjty ty) (disjident id) (disjini ini) + disjmult3 S.strip_template_parameter (disjty ty) (disjident id) (disjini ini) (fun ty id exp -> Ast.rewrap p (Ast.VarNameParam(ty,id,Some(eq,ini)))) | Ast.VarNameParam(ty,id,None) -> - disjmult2 (disjty ty) (disjident id) + disjmult2 S.strip_template_parameter (disjty ty) (disjident id) (fun ty id -> Ast.rewrap p (Ast.VarNameParam(ty,id,None))) | Ast.TPComma(comma) -> [p] | Ast.TPDots(dots) -> [p] @@ -372,7 +415,7 @@ | Ast.InitGccExt(designators,eq,ini) -> let designators = disjmult designator designators in let ini = disjini ini in - disjmult2 designators ini + disjmult2 S.strip_initialiser designators ini (function designators -> function ini -> Ast.rewrap i (Ast.InitGccExt(designators,eq,ini))) | Ast.InitGccName(name,eq,ini) -> @@ -394,7 +437,7 @@ let exp = disjexp exp in List.map (function exp -> Ast.DesignatorIndex(lb,exp,rb)) exp | Ast.DesignatorRange(lb,min,dots,max,rb) -> - disjmult2 (disjexp min) (disjexp max) + disjmult2 (fun x -> x) (disjexp min) (disjexp max) (function min -> function max -> Ast.DesignatorRange(lb,min,dots,max,rb)) @@ -415,23 +458,23 @@ let decl = disjdecl decl in List.map (function decl -> Ast.rewrap d (Ast.AsDecl(decl,asdecl))) decl | Ast.Init(align,stg,ty,id,endattr,eq,ini,sem) -> - disjmult4 (disjalign align) (disjty ty) (disjident id) (disjini ini) + disjmult4 S.strip_declaration (disjalign align) (disjty ty) (disjident id) (disjini ini) (fun al ty id ini -> Ast.rewrap d (Ast.Init(al,stg,ty,id,endattr,eq,ini,sem))) | Ast.UnInit(align,stg,ty,id,endattr,sem) -> - disjmult3 (disjalign align) (disjty ty) (disjident id) + disjmult3 S.strip_declaration (disjalign align) (disjty ty) (disjident id) (fun al ty id -> Ast.rewrap d (Ast.UnInit(al,stg,ty,id,endattr,sem))) | Ast.FunProto(fninfo,name,lp1,params,va,rp1,sem) -> - disjmult2 (disjmult disjfninfo fninfo) (disjident name) + disjmult2 S.strip_declaration (disjmult disjfninfo fninfo) (disjident name) (fun fninfo name -> Ast.rewrap d (Ast.FunProto(fninfo,name,lp1,params,va,rp1,sem))) | Ast.MacroDecl(stg,preattr,name,lp,args,rp,attr,sem) -> - disjmult2 (disjident name) (disjdots disjexp args) + disjmult2 S.strip_declaration (disjident name) (disjdots disjexp args) (fun name args -> Ast.rewrap d (Ast.MacroDecl(stg,preattr,name,lp,args,rp,attr,sem))) | Ast.MacroDeclInit(stg,preattr,name,lp,args,rp,attr,eq,ini,sem) -> - disjmult3 (disjident name) (disjdots disjexp args) (disjini ini) + disjmult3 S.strip_declaration (disjident name) (disjdots disjexp args) (disjini ini) (fun name args ini -> Ast.rewrap d (Ast.MacroDeclInit(stg,preattr,name,lp,args,rp,attr,eq,ini,sem))) @@ -441,7 +484,7 @@ | Ast.Typedef(stg,ty,id,sem) -> let ty = disjty ty in (* disj not allowed in id *) List.map (function ty -> Ast.rewrap d (Ast.Typedef(stg,ty,id,sem))) ty - | Ast.DisjDecl(decls) -> List.concat (List.map disjdecl decls) + | Ast.DisjDecl(decls) -> flatconcat S.strip_declaration (List.map disjdecl decls) | Ast.ConjDecl(decl_list) -> let decl_list = disjmult disjdecl decl_list in List.map (function decl_list -> Ast.rewrap d (Ast.ConjDecl(decl_list))) @@ -456,11 +499,11 @@ | Ast.MetaFieldList(_,_,_,_,_) -> [d] | Ast.Field(ty,id,bf,endattr,sem) -> let disjbf (c, e) = List.map (fun e -> (c, e)) (disjexp e) in - disjmult3 (disjty ty) (disjoption disjident id) (disjoption disjbf bf) + disjmult3 S.strip_field (disjty ty) (disjoption disjident id) (disjoption disjbf bf) (fun ty id bf -> Ast.rewrap d (Ast.Field(ty,id,bf,endattr,sem))) | Ast.MacroDeclField(name,lp,args,rp,attr,sem) -> - disjmult2 (disjident name) (disjdots disjexp args) + disjmult2 S.strip_field (disjident name) (disjdots disjexp args) (fun name args -> Ast.rewrap d (Ast.MacroDeclField(name,lp,args,rp,attr,sem))) | Ast.CppField di -> @@ -478,7 +521,7 @@ Ast.rewrap di (Ast.UsingNamespace(usng,nmspc,name,sem))) name | Ast.UsingTypename(usng,name,eq,tn,ty,sem) -> - disjmult2 (disjident name) (disjty ty) + disjmult2 (fun x -> x) (disjident name) (disjty ty) (fun name ty -> Ast.rewrap di (Ast.UsingTypename(usng,name,eq,tn,ty,sem))) | Ast.UsingMember(usng,name,sem) -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/parsing_cocci/strip_ast.ml new/coccinelle-1.3.1/parsing_cocci/strip_ast.ml --- old/coccinelle-1.3.1/parsing_cocci/strip_ast.ml 1970-01-01 01:00:00.000000000 +0100 +++ new/coccinelle-1.3.1/parsing_cocci/strip_ast.ml 2026-01-20 15:51:07.000000000 +0100 @@ -0,0 +1,49 @@ +(* strip modifications and line numbers to allow identifying identical +expressions, eg in a disjunction *) + +module Ast = Ast_cocci +module V = Visitor_ast + +(* This treats no terms specially, so some identifying information could be +retained at paces not considered by the visitor. For the purpose of +finding duplicate terms this will just give false negatives, which does not +compromise correctness. *) + +let strip = + let mcode x = Ast.make_mcode (Ast.unwrap_mcode x) in + let donothing r k e = Ast.make_term(Ast.unwrap(k e)) in + V.rebuilder {V.rmcode=mcode} {V.rdonothing=donothing} (fun r k e -> k e) + +let strip_ident = strip.V.rebuilder_ident +let strip_expression = strip.V.rebuilder_expression +let strip_fragment = strip.V.rebuilder_fragment +let strip_format = strip.V.rebuilder_format +let strip_assignOp = strip.V.rebuilder_assignOp +let strip_binaryOp = strip.V.rebuilder_binaryOp +let strip_fullType = strip.V.rebuilder_fullType +let strip_typeC = strip.V.rebuilder_typeC +let strip_declaration = strip.V.rebuilder_declaration +let strip_field = strip.V.rebuilder_field +let strip_ann_field = strip.V.rebuilder_ann_field +let strip_enumdecl = strip.V.rebuilder_enumdecl +let strip_initialiser = strip.V.rebuilder_initialiser +let strip_parameter = strip.V.rebuilder_parameter +let strip_template_parameter = strip.V.rebuilder_template_parameter +let strip_parameter_list = strip.V.rebuilder_parameter_list +let strip_statement = strip.V.rebuilder_statement +let strip_case_line = strip.V.rebuilder_case_line +let strip_attribute = strip.V.rebuilder_attribute +let strip_attr_arg = strip.V.rebuilder_attr_arg +let strip_rule_elem = strip.V.rebuilder_rule_elem +let strip_top_level = strip.V.rebuilder_top_level +let strip_expression_dots = strip.V.rebuilder_expression_dots +let strip_statement_dots = strip.V.rebuilder_statement_dots +let strip_anndecl_dots = strip.V.rebuilder_anndecl_dots +let strip_annfield_dots = strip.V.rebuilder_annfield_dots +let strip_enumdecl_dots = strip.V.rebuilder_enumdecl_dots +let strip_initialiser_dots = strip.V.rebuilder_initialiser_dots +let strip_define_param_dots = strip.V.rebuilder_define_param_dots +let strip_define_param = strip.V.rebuilder_define_param +let strip_define_parameters = strip.V.rebuilder_define_parameters +let strip_anything = strip.V.rebuilder_anything + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/parsing_cocci/strip_ast.mli new/coccinelle-1.3.1/parsing_cocci/strip_ast.mli --- old/coccinelle-1.3.1/parsing_cocci/strip_ast.mli 1970-01-01 01:00:00.000000000 +0100 +++ new/coccinelle-1.3.1/parsing_cocci/strip_ast.mli 2026-01-20 15:51:07.000000000 +0100 @@ -0,0 +1,25 @@ +val strip_ident : Ast_cocci.ident -> Ast_cocci.ident +val strip_expression : Ast_cocci.expression -> Ast_cocci.expression +val strip_fragment : Ast_cocci.string_fragment -> Ast_cocci.string_fragment +val strip_format : Ast_cocci.string_format -> Ast_cocci.string_format +val strip_assignOp : Ast_cocci.assignOp -> Ast_cocci.assignOp +val strip_binaryOp : Ast_cocci.binaryOp -> Ast_cocci.binaryOp +val strip_fullType : Ast_cocci.fullType -> Ast_cocci.fullType +val strip_typeC : Ast_cocci.typeC -> Ast_cocci.typeC +val strip_declaration : Ast_cocci.declaration -> Ast_cocci.declaration +val strip_field : Ast_cocci.field -> Ast_cocci.field +val strip_ann_field : Ast_cocci.annotated_field -> Ast_cocci.annotated_field +val strip_enumdecl : Ast_cocci.enum_decl -> Ast_cocci.enum_decl +val strip_initialiser : Ast_cocci.initialiser -> Ast_cocci.initialiser +val strip_parameter : Ast_cocci.parameterTypeDef -> Ast_cocci.parameterTypeDef +val strip_template_parameter : Ast_cocci.templateParameterTypeDef -> Ast_cocci.templateParameterTypeDef +val strip_parameter_list : Ast_cocci.parameter_list -> Ast_cocci.parameter_list +val strip_statement : Ast_cocci.statement -> Ast_cocci.statement +val strip_case_line : Ast_cocci.case_line -> Ast_cocci.case_line +val strip_attribute : Ast_cocci.attr -> Ast_cocci.attr +val strip_attr_arg : Ast_cocci.attr_arg -> Ast_cocci.attr_arg +val strip_rule_elem : Ast_cocci.rule_elem -> Ast_cocci.rule_elem +val strip_top_level : Ast_cocci.top_level -> Ast_cocci.top_level +val strip_define_param : Ast_cocci.define_param -> Ast_cocci.define_param +val strip_define_parameters : Ast_cocci.define_parameters -> Ast_cocci.define_parameters +val strip_anything : Ast_cocci.anything -> Ast_cocci.anything diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccinelle-1.3.1/setup/fake-subst.sh new/coccinelle-1.3.1/setup/fake-subst.sh --- old/coccinelle-1.3.1/setup/fake-subst.sh 2025-11-18 10:48:08.000000000 +0100 +++ new/coccinelle-1.3.1/setup/fake-subst.sh 2026-01-20 15:51:07.000000000 +0100 @@ -19,7 +19,7 @@ # the next lines in the file. # the replies file assumes that the -# libpcre and python libraries are installed, and +# libpcre2 and python libraries are installed, and # that none of the optional ocaml libraries are # installed. @@ -102,9 +102,9 @@ echo "-L${prefix}/lib -lpython${version}" } -# succeeds only if "/usr/include/pcre.h" exists +# succeeds only if "/usr/include/pcre2.h" exists checkpcre() { - test -f /usr/include/pcre.h + test -f /usr/include/pcre2.h } # iterate through pattern-response pairs
