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)
Mon, Jul 7, 4:55 AM
Unknown Object (File)
Sun, Jul 6, 11:59 PM
Unknown Object (File)
Fri, Jul 4, 12:04 PM
Unknown Object (File)
Fri, Jun 27, 2:27 AM
Unknown Object (File)
Wed, Jun 25, 2:14 PM
Unknown Object (File)
Wed, Jun 25, 1:11 PM
Unknown Object (File)
Tue, Jun 24, 12:39 AM
Unknown Object (File)
Sun, Jun 22, 6:38 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.