lkml.org 
[lkml]   [2006]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: Conversion to generic boolean
    From
    Date
    Ar Maw, 2006-08-29 am 12:41 +0100, ysgrifennodd Christoph Hellwig:
    > gcc lets you happily assign any integer value to bool/_Bool, so unless
    > you write sparse support for actually checking things there's not the
    > slightest advantage in value range checking.

    Not the case: gcc allows you to assign 0 or 1 to an _Bool type object.
    When you are "assigning" integers you are merely seeing implicit casting
    before the assignment.

    Try int a = 4; _Bool b = a; int c = b; printf("%d\n", c);

    Alan

    -
    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/

    \
     
     \ /
      Last update: 2006-08-29 14:31    [W:0.021 / U:0.840 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site