Page MenuHomeFreeBSD

sys/queue.h: use reserved identifiers with the file scope for locals
ClosedPublic

Authored by kib on May 6 2025, 6:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 7:00 AM
Unknown Object (File)
Wed, Oct 8, 1:54 AM
Unknown Object (File)
Sun, Sep 28, 6:18 AM
Unknown Object (File)
Sep 13 2025, 3:44 AM
Unknown Object (File)
Sep 8 2025, 10:20 AM
Unknown Object (File)
Sep 8 2025, 1:21 AM
Unknown Object (File)
Sep 7 2025, 8:27 PM
Unknown Object (File)
Sep 7 2025, 5:46 AM
Subscribers

Details

Summary

This should prevent conflicts with the C-standard compliant code, although sys/queue.h is not a standard header.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.May 6 2025, 6:17 PM

For me __curelm is a bit more readable than _Curelm, but I'm fine with this versino as well.

This revision is now accepted and ready to land.May 6 2025, 6:30 PM

For me __curelm is a bit more readable than _Curelm, but I'm fine with this versino as well.

7.1.3 Reserved identifiers
— All identifiers that begin with an underscore and either an uppercase letter or another under-
score are always reserved for any use, except those identifiers which are lexically identical to
keywords.187)
— All identifiers that begin with an underscore are always reserved for use as identifiers with file
scope in both the ordinary and tag name spaces.
...

I.e. only _[A-Z].* are allowed for use in macros.