[Top] [All Lists]

Re: Fwd: [RFC] SGI O2 MACE audio ALSA module

To: TJ <>
Subject: Re: Fwd: [RFC] SGI O2 MACE audio ALSA module
From: Geert Uytterhoeven <>
Date: Fri, 6 Jul 2007 11:01:40 +0200 (CEST)
Cc: "" <>, Linux MIPS List <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <>
On Fri, 6 Jul 2007, TJ wrote:
> I can see the case against other uses of typedef, but I really do not
> see why typedef struct is so bad. seeing 'struct mything_s *foo;'
> doesn't really tell you anything more about foo then 'mything_t *foo;'
> does. If a typedef was something other then a struct then I would want
> it to have an obvious name that said such, eg 'u64'. (I really don't
> like 'size_t')

You can have simple forward declarations for structs:

    struct mystruct;

    extern void myfunc(struct mystruct *p);

while you need the full struct definition for typedefs:

    typedef struct mystruct {
        int myfield;
    } mytype_t;

    extern void myfunc(mytype_t *p);

I.e. more (possibly circular) include dependencies.



Geert Uytterhoeven -- There's lots of Linux beyond ia32 --

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds

<Prev in Thread] Current Thread [Next in Thread>