Page MenuHomeFreeBSD

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

Authored by kib on Tue, May 6, 6:17 PM.
Tags
None
Referenced Files
F116961843: D50216.diff
Mon, May 12, 1:20 PM
Unknown Object (File)
Sat, May 10, 9:51 AM
Unknown Object (File)
Thu, May 8, 11:10 PM
Unknown Object (File)
Thu, May 8, 5:20 PM
Unknown Object (File)
Thu, May 8, 1:16 PM
Unknown Object (File)
Thu, May 8, 12:13 PM
Unknown Object (File)
Tue, May 6, 10:21 PM
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.Tue, May 6, 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.Tue, May 6, 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.