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
F137277083: D50216.id155017.diff
Sat, Nov 22, 12:03 AM
Unknown Object (File)
Wed, Nov 12, 3:19 PM
Unknown Object (File)
Wed, Oct 29, 9:59 AM
Unknown Object (File)
Wed, Oct 29, 9:36 AM
Unknown Object (File)
Tue, Oct 28, 4:21 PM
Unknown Object (File)
Oct 19 2025, 7:27 AM
Unknown Object (File)
Oct 10 2025, 7:00 AM
Unknown Object (File)
Oct 8 2025, 1:54 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.