[9fans] const if false - Plan9

This is a discussion on [9fans] const if false - Plan9 ; it's on something like this: if (A != 0 && keylen != A) { } gets an error 'const if false' A is defined to zero. So, what do I care if 'const if false'. I did not write this ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: [9fans] const if false

  1. [9fans] const if false

    it's on something like this:

    if (A != 0 && keylen != A) {
    }


    gets an error 'const if false'

    A is defined to zero. So, what do I care if 'const if false'. I did
    not write this code ... but it's what they want, evidently.

    ron

  2. Re: [9fans] const if false

    2007/1/16, ron minnich :
    > it's on something like this:
    >
    > if (A != 0 && keylen != A) {
    > }
    >
    >
    > gets an error 'const if false'
    >
    > A is defined to zero. So, what do I care if 'const if false'. I did
    > not write this code ... but it's what they want, evidently.


    I guess because the first part of the if is always false, the if is
    useless and it is telling you to fix `your' code.

    --dho

    > ron
    >


  3. Re: [9fans] const if false

    It sounds like you are running 8c -c file.c
    to compile file.c into an object file.
    This is a typical Unix command line,
    but on Plan 9 the compilers create object
    files, not executables, by default, so
    you can just say "8c file.c". Adding -c
    just sets the 'c' flag, which causes the
    compiler to print some more information
    about control flow, in this case a print about
    the const if false.

    If you just run 8c file.c (or even 8c -w file.c),
    you shouldn't see this message. If you still
    see a message, please report exactly what it is.

    Russ

  4. Re: [9fans] const if false

    On 1/16/07, Russ Cox wrote:
    > It sounds like you are running 8c -c file.c
    > to compile file.c into an object file.


    That's it. I missed that when converting this python goo.

    Thanks

    ron

+ Reply to Thread