[U-Boot] "_ENTRY" is both a struct and a typedef?

Peter.Chubb at data61.csiro.au Peter.Chubb at data61.csiro.au
Thu Sep 8 22:34:25 CEST 2016


>>>>> "Robert" == Robert P J Day <rpjday at crashcourse.ca> writes:

Robert>   from lib/hashtable.c:

Robert>   typedef struct _ENTRY { int used; ENTRY entry; } _ENTRY;

Robert> ok, that's just kind of creepy ... defining a typedef over top
Robert> of a struct of the same name. does anyone else find that
Robert> strange?

It's standard practice in some C styles.  Personally I'd delete the
struct tag, as the typedef should be used everywhere instead.

Peter C
-- 
Dr Peter Chubb         Tel: +61 2 9490 5852      http://ts.data61.csiro.au/
Trustworthy Systems Group                           Data61 (formerly NICTA)


More information about the U-Boot mailing list