Re: [IDEA+RFC] Possible solution for min()/max() war

Peter T. Breuer (ptb@it.uc3m.es)
Fri, 31 Aug 2001 00:06:22 +0200 (MET DST)


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