public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
* [cocci] [PATCH v1 0/1] scripts/coccinelle: Add script for using ARRAY_END()
@ 2026-03-05 23:20 Alejandro Colomar
  2026-03-05 23:20 ` [cocci] [PATCH v1 1/1] " Alejandro Colomar
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Alejandro Colomar @ 2026-03-05 23:20 UTC (permalink / raw)
  To: Julia Lawall, Nicolas Palix, cocci; +Cc: Alejandro Colomar, Kees Cook

Hi!

This is a script to help find and replace uses of ARRAY_SIZE() to find
the end of an array (a pointer one past the last element).  We already
replaced some uses a few months ago, fixing some bugs while doing that,
and now I've written a coccinelle patch to do it elsewhere.

This is the first time I write a script under scripts/coccinelle/, so
take it with a grain of salt.  I've tested it, and I see no false
positives.  However, I've found several false negatives (for example,
in macros, or where the argument is a struct member).


Have a lovely night!
Alex


Alejandro Colomar (1):
  scripts/coccinelle: Add script for using ARRAY_END()

 scripts/coccinelle/misc/array_end.cocci | 93 +++++++++++++++++++++++++
 1 file changed, 93 insertions(+)
 create mode 100644 scripts/coccinelle/misc/array_end.cocci

Range-diff against v0:
-:  -------- > 1:  f1c9dff5 scripts/coccinelle: Add script for using ARRAY_END()
-- 
2.53.0


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-03-17  9:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 23:20 [cocci] [PATCH v1 0/1] scripts/coccinelle: Add script for using ARRAY_END() Alejandro Colomar
2026-03-05 23:20 ` [cocci] [PATCH v1 1/1] " Alejandro Colomar
2026-03-09 11:17   ` [cocci] [PATCH] " Markus Elfring
2026-03-09 11:59     ` Julia Lawall
2026-03-09 12:16       ` Alejandro Colomar
2026-03-09 12:10     ` Alejandro Colomar
2026-03-09 12:21       ` Julia Lawall
2026-03-09 12:27         ` Alejandro Colomar
2026-03-09 12:13 ` [cocci] [PATCH v2] " Alejandro Colomar
2026-03-09 14:05   ` Markus Elfring
2026-03-09 14:32     ` Alejandro Colomar
2026-03-15 17:17       ` Alejandro Colomar
2026-03-15 17:54         ` Julia Lawall
2026-03-15 22:05           ` Alejandro Colomar
2026-03-16  7:18         ` [cocci] [v2] " Markus Elfring
2026-03-16 10:39           ` Alejandro Colomar
2026-03-16 10:46             ` Markus Elfring
2026-03-15 22:11 ` [cocci] [PATCH v3] " Alejandro Colomar
2026-03-15 22:12   ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox