Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Compilation on Ultrix cc



>The patch below should remove the warnings on Ultix with cc.  It removes
>the #ifdef ULTRIX lines from glob.c and always uses Statptr in place of
>struct stat *.  I also removed the #error directive from builtin.c and
>repladed with comething which should generate a syntax error (but I hope
>that noone will see this error).
[...]
> ! #  error there are some unknown limits.  Fixme!
> --- 3535,3541 ----
> !    there are some unknown limits.  Fixme!

Actually the usually preferred way to do #error is thus:

#if SOME_PROBLEMATIC_CONDITION
 #error Fix me.
#endif

This works because K&R preprocessors don't recognise preprocessor
directives unless the # is in column 1.  In this case, they would pass
the "#error Fix me." text through to the compiler, which will barf just
as it would without the "#error".  The advantages of this technique are
(1) ANSI compilers will abort properly, and (2) it makes it clearer
that this is intended to abort compilation.

-zefram




Messages sorted by: Reverse Date, Date, Thread, Author