Jacek Luczak writes:
> Hi All,
>
> I've found that in many enum lists, there's a comma at the end, e.g.
> (arch/x86/kernel/early_printk.c):
>
> enum {
> MAGIC1 = 0xBACCD00A,
> MAGIC2 = 0xCA110000,
> XOPEN = 5,
> XWRITE = 4,
> };
>
> Just out of curiosity, is there any particular reason here (no word in
> CodingStyle about that).
Yes. This idiom allows you to add or remove items without
changing adjacent lines.
In a language with strict a comma-as-separator rule you can
get this benefit by placing the comma before new items rather
than after existing items:
enum { FOO
,FIE
,FUM
};
but luckily C doesn't need this perversion.
--
| Peter Zijlstra | [PATCH 6/6] sched: disabled rt-bandwidth by default |
| Tejun Heo | [PATCHSET] FUSE: extend FUSE to support more operations |
| Avi Kivity | [PATCH 041/104] KVM: Don't assign vcpu->cr3 if it's invalid: check first, set last |
| Vegard Nossum | [RFC][PATCH] bitfields API |
git: | |
| Rogan Dawes | Re: kernel.org mirroring (Re: [GIT PULL] MMC update) |
| David Kastrup | Terminology question about remote branches. |
| Tony Stubbs | git svn rebase - could not detach HEAD |
| Nicolas Pitre | Re: Understanding version 4 packs |
| James Hartley | scp batch mode? |
| Firas Kraiem | Possible mug in mini_sendmail-chroot. |
| Gregory Edigarov | Question on interface enumeration |
| bsd_news | LC_COLLATE and PostgreSQL |
| Jeff Garzik | Re: [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM |
| Jay Vosburgh | [PATCH 6/9] net/bonding: Handlle wrong assumptions that slave is always an Etherne... |
| Radu Rendec | Re: Endianness problem with u32 classifier hash masks |
| Robert Olsson | [PATCH] pktgen multiqueue etc |
