lkml.org 
[lkml]   [2001]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [IDEA+RFC] Possible solution for min()/max() war
    Date
    "Mark Zealey wrote:"
    > On Thu, Aug 30, 2001 at 11:32:55PM +0200, Peter T. Breuer wrote:
    > > unsafe_min_or_max_at_line_##__LINE__()
    > >
    > umm, no, the ## is removed and you are left with:
    > undefined reference to `unsafe_min_or_max_at_line___LINE__'

    Not sure about that ... I'm willing to believe you, but even so surely
    it would be possible to get round with the usual kind of cpp fiddle?
    Something like

    #define LINE(x,y) x##y
    ...
    LINE(unsafe_min_or_max_at_line_,__LINE__)()

    > The best I can think of would be something like:
    > asm(".unsafe_use_of_min_or_max_in_" __FUNCTION__)
    >
    > which would not give you the line number, as the line number is only avalable in

    #define stringify(x) #x
    asm(".unsafe_use_of_min_or_max_at_line_" stringify(__LINE__))

    > integer form, I doubt you will be able to get that very well. The assembler will

    Peter
    -
    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: 2005-03-22 13:01    [W:3.876 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site