On Jun 11, 2001, Akim Demaille <[EMAIL PROTECTED]> wrote:

> It's very easy to set a guard against such compilers.  But once we
> detected the compiler cannot evaluate such expressions, what do we do?

Would it work with a switch/case statement instead of an array
declaration?  In this case, we could introduce a test to decide
whether to use negative-sized array declarations or duplicate case
labels in such compile tests, and introduce a macro that would expand
to a block statement that performed the test.

If neither negative-sized array nor duplicate case label can be used
to detect errors, we're in trouble, and we'll have to either fallback
to a run-time test (that wouldn't work in case of cross-compilers
anyway, but the most commonly used cross compiler isn't that broken
:-) or bail out reporting that the compiler cannot detect the correct
value for a compile-time test.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Reply via email to