On Monday November 7, [email protected] wrote: > > This was for the simple reason, too many developers were passing > structures by value instead of by reference, just because they were > using a type that they didn't realize was a structure. And to make > things worse, these structures started to get bigger. > Another reason for not using typedefs is that if you do, and you want to refer to the structure in some other include file, you have to #include the include file that devices the structure. If you don't use typedefs, you can just say: struct foo; and the compiler will happily wait for the complete definition later (providing it doesn't need the size in the meanwhile). So avoiding typedef means that you can sometimes avoid excess #includes, which means faster compiling. NeilBrown - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Denis Vlasenko <[email protected]>
- Re: typedefs and structs
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- References:
- [PATCH 0/42] PCI Error Recovery for PPC64 and misc device drivers
- From: Linas Vepstas <[email protected]>
- [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Linas Vepstas <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Greg KH <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Paul Mackerras <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: linas <[email protected]>
- Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks
- From: Greg KH <[email protected]>
- typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Greg KH <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Greg KH <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: linas <[email protected]>
- Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- From: Steven Rostedt <[email protected]>
- [PATCH 0/42] PCI Error Recovery for PPC64 and misc device drivers
- Prev by Date: Re: [dm-devel] Re: [PATCH resubmit] do_mount: reduce stack consumption
- Next by Date: Re: [RFC 1/2] Hugetlb fault fixes and reorg
- Previous by thread: Re: typedefs and structs [was Re: [PATCH 16/42]: PCI: PCI Error reporting callbacks]
- Next by thread: Re: typedefs and structs
- Index(es):