Thread View: gnu.bash.bug
1 messages
1 total messages
Started by perf
Mon, 03 Jul 1989 16:57
advance macro in test.c - warning
Author: perf
Date: Mon, 03 Jul 1989 16:57
Date: Mon, 03 Jul 1989 16:57
39 lines
1353 bytes
1353 bytes
This is from test.c:
-------------------
/*
* advance - increment our position in the argument list. Check that
* we're not past the end of the argument list. This check is
* supressed if the argument is FALSE. made a macro for efficiency.
*/
#ifndef lint
#define advance(f) (++pos, f && (pos < argc ? 0 : beyond()))
#endif
#if !defined(advance)
static int
advance(f)
int f;
{
++pos;
if (f && pos >= argc)
beyond();
}
#endif
-------------------
Some brain damaged compilers evaluate the conditional expression even
if `f' is FALSE.
So if you get "[: argument expected" that's prabably the problem.
Maybe an #ifdef __GNUC__ or #ifndef BRAIN_DAMAGE should be added to
the code...
--
Per Foreby
System manager at EFD, Lund Institute of Technology (Lund University)
Snail: E-huset, Tekniska Hogskolan i Lund, Box 118, S-221 00 LUND, Sweden.
Email: perf@efd.lth.se Phone: int + 46 46-10 75 98
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads