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

ptb@it.uc3m.es said:
> Now I think of it, I suppose
> unsafe_min_or_max_at_line_##__LINE__()
> will definitely evoke a meaningful link error.

Unfortunately, there's no guarantee that it won't emit a reference to that
symbol even if the test for mismatching arguments can be proved at compile
time to always evaluate to false.

Code which relies on "if(0) __call_nonexistent_function();" actually compiling
is just broken.

You'd have thought we'd have learned by now to stop relying on the observed
current behaviour of gcc and start trying to get it right, wouldn't you?

The answer in this case is that gcc can't safely do what we require for this
and for other compile-time checks, until something like David's
__builtin_ct_assertion() is added.

--
dwmw2


-
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:0.072 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site