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

Mark Zealey (mark@itsolve.co.uk)
Thu, 30 Aug 2001 22:49:27 +0100


On Thu, Aug 30, 2001 at 11:32:55PM +0200, Peter T. Breuer wrote:

> Now I think of it, I suppose
>
> unsafe_min_or_max_at_line_##__LINE__()
>
> will definitely evoke a meaningful link error.

umm, no, the ## is removed and you are left with:
undefined reference to `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
integer form, I doubt you will be able to get that very well. The assembler will
give a line in relation to the asm, rather than the C, which is not what you
want...

> I still suspect that illegal assembler will do the job, since it must
> be treated after gcc has produced assembler itself and line references
> must still be present then for the assembler to be able to give meaningful
> error messages (;), but assembler is not something I write, so someone
> else needs to say.

Those are in relation to the assembler, not the C code..

-- 

Mark Zealey mark@itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$ !E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---? !R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--

(www.geekcode.com) - 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/