Re: [2.6 patch] drivers/block/nbd.c: don't defer compile error to runtime

From: Adam Kropelin (akropel1_at_rochester.rr.com)
Date: 09/03/05

  • Next message: Jonathan Zuma: "Greetingss From Jonathan"
    Date:	Fri, 2 Sep 2005 19:20:47 -0400
    To: Adrian Bunk <bunk@stusta.de>
    
    

    Adrian Bunk wrote:
    > If we can detect a problem at compile time, the compilation should
    > fail.

    [...]

    > if (sizeof(struct nbd_request) != 28) {
    > - printk(KERN_CRIT "nbd: sizeof nbd_request needs to be 28 in order to work!\n" );
    > - return -EIO;
    > + extern void nbd_request_wrong_size(void);
    > + nbd_request_wrong_size();

            BUILD_BUG_ON(sizeof(struct nbd_request) != 28);

    ...perhaps?

    --Adam

    -
    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: Jonathan Zuma: "Greetingss From Jonathan"

    Relevant Pages

    • Re: clamd keeps exiting
      ... >> Maybe the program is linked to some libs during compile time, ... Michael D. Whities ... To unsubscribe, ...
      (freebsd-questions)
    • Re: new.h is missing
      ... On Tuesday 29 July 2003 11:54, Kai Mosebach wrote: ... > im trying to port a software, and on compile time i get ... To unsubscribe, ...
      (freebsd-current)
    • RE: make -j$n buildworld : use of -j investigated
      ... > resonable estimate about the compile time. ... anything close to the benefit of a second physical CPU. ... To unsubscribe, ...
      (freebsd-stable)
    • Re: compiling
      ... "Paul Akkermans" writes: ... I think that not all libraries are included ... > during compile time. ... To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org ...
      (Debian-User)
    • RE: drive space shell script help ?
      ... > # You have to get rid of the word 'Capacity' or your comparison will ... > will fail. ... > Got a computer with idle CPU time? ... To unsubscribe, ...
      (freebsd-questions)