1
0
mirror of https://github.com/systemd/systemd synced 2024-07-09 04:26:06 +00:00
Commit Graph

4 Commits

Author SHA1 Message Date
Matteo Croce
64f7b2961a introduce FOREACH_ELEMENT
Add a FOREACH_ELEMENT() macro which just passes ELEMENTSOF(v)
as third argument to FOREACH_ARRAY().
2024-04-18 17:39:34 +02:00
Frantisek Sumsal
cd4b16c082 coccinelle: drop a couple of FIXMEs
Turns out Coccinelle can handle compound literals just fine, the parsing
errors were caused by incorrectly parsed macros in code before the
literals, so let's just provide simplified versions for such macros.

The parsing error in `Type *foo[ELEMENTSOF(bar)] = {};` is actually
harmless; it occurs only when creating an array of pointers for a type
that's in an external header and it occurs only on the first parser's
pass, subsequent passes resolve the type correctly.

Also, unset ENABLE_DEBUG_HASHMAP, so Coccinelle doesn't expand the
hashmap debug macros.

As for the remaining FIXMEs, I opened a couple of issues in the
Coccinelle upstream to see if they can be fixed there (or at least
properly analyzed).
2024-01-02 19:12:05 +01:00
Yu Watanabe
a1ccd5eed8 coccinelle: fix typo
Follow-up for b25d3b36a2.
2023-12-29 04:13:45 +09:00
Frantisek Sumsal
b25d3b36a2 coccinelle: help Coccinelle with some more complex macros
Drop the original macro file, since it's not needed anymore thanks to
resolving includes properly, but introduce a similar file -
parsing_hacks.h - that helps Coccinelle in some specific corner cases.

This eliminates most of the outstanding parsing errors in source files.
The remaining ones are limitations of the parsing engine (see the FIXMEs
in pasing_hacks.h) and need further investigation.
2023-12-27 11:15:48 +01:00