Page MenuHomeFreeBSD

libsysdecode: parse enums
AcceptedPublic

Authored by glebius on Fri, Jun 26, 5:03 AM.
Tags
None
Referenced Files
F161018255: D57865.id180675.diff
Mon, Jun 29, 9:38 PM
F160973871: D57865.id180730.diff
Mon, Jun 29, 1:04 PM
F160936725: D57865.diff
Mon, Jun 29, 6:02 AM
Unknown Object (File)
Sun, Jun 28, 10:26 PM
Unknown Object (File)
Fri, Jun 26, 5:39 PM
Subscribers

Details

Reviewers
kp
Group Reviewers
Src Committers
Summary

Teach mktables script to parse enums. Works only with clang build. As a
demo repair shutdown(2) argument parsing, that was broken since
c3276e02beab.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74306
Build 71189: arc lint + arc unit

Event Timeline

kp added inline comments.
lib/libsysdecode/mktables
139

This is missing the TABLE_ENTRY.

(Discovered test-building the follow-up pf patch).

  • Pushed one to final version. Fixup.
This revision is now accepted and ready to land.Fri, Jun 26, 2:58 PM

There's no need for a clang-only solution, you can handle enums just fine with only regular expressions as long as the names are sufficiently distinctive.

I don't want this library to dictate naming of enums all around. The whole idea of using text parser to parse C files is fragile. Clang delivers a proper solution. Hopefully gcc will catch up.