Re: Linux 2.6.0-test6

From: Russell King (rmk_at_arm.linux.org.uk)
Date: 09/28/03

  • Next message: Jamie Lokier: "Re: Linux 2.6.0-test6"
    Date:	Sun, 28 Sep 2003 20:42:24 +0100
    To: Jörn Engel <joern@wohnheim.fh-wedel.de>
    
    

    On Sun, Sep 28, 2003 at 09:16:22PM +0200, Jörn Engel wrote:
    > How about a check_headers target that roughly works like this:
    >
    > for (all header files in include/linux and include/asm) {
    > echo "#include <$HEADER>" > header.c
    > make header.o
    > rm header.c header.o
    > }
    >
    > Did a quick test for linux/fs.h in -test5 and it compiled fine, but
    > broke after removing some random #include.
    >
    > Another thing, Sam, "make header.o" causes make to call itself
    > indefinitely. Had to "make somedir/header.o". Not sure if you
    > consider this to be a bug, your decision.

    I have a bad feeling about this, so I'll make the following comments
    up front before all the reports start rolling in. It may be a good
    idea to document this somewhere. (Coding style?)

    If a header has something like these:

    struct my_headers_struct {
            struct task_struct *tsk;
    };

    void my_function(struct task_struct *tsk);

    and gcc warns that "struct task_struct" has not been declared, please
    don't think about adding another header. Just declare the structure
    in the header file which needs it like this:

    struct task_struct;

    and that will prevent the #include maze of 2.4, which resulted in
    everything being rebuilt just because one header file was touched.

    -- 
    Russell King (rmk@arm.linux.org.uk)	http://www.arm.linux.org.uk/personal/
          Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
          maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                          2.6 Serial core
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Jamie Lokier: "Re: Linux 2.6.0-test6"

    Relevant Pages

    • [PATCH] remove unnecessary #includes from <linux/fs.h>
      ... >> everything being rebuilt just because one header file was touched. ... struct nameidata; ... extern int is_subdir ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Basic, basic, C question!
      ... struct tag_ts will only be required once in the whole program! ... convince me to use extern or typedef for *every* structure and pass its ... variables *defined* in a header file. ... now if i want declare a variable of this ...
      (microsoft.public.vc.language)
    • [PATCH] scx200_gpio export cleanups
      ... and declare the struct in the header file for access by other modules. ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: Basic, basic, C question!
      ... typedef struct tag_ts ... convince me to use extern or typedef for *every* structure and pass its ... variables *defined* in a header file. ... now if i want declare a variable of this ...
      (microsoft.public.vc.language)
    • Re: 2.6.11-mm3 breaks compile of drivers/char/esp.c
      ... Seems that Alan's diff was missing the changes to the header file. ... struct esp_struct { ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)