* Scan for __attribute__((...)) in general (the earliest was 2.5,
where we had 'noreturn' etc. but no '__noreturn__') * Scan for __attribute__((bounded)) and __attribute__((used)) if we have __attribute__((noreturn)) * To be able to scan if certain attributes give warnings, scan for -Werror with a simple programme which hopefully triggers none * Convert __attribute__((unused)) to __unused, noreturn -> __dead * Unify other attributes * Clean up typography a little more
This commit is contained in:
40
Build.sh
40
Build.sh
@ -1,15 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $MirOS: src/bin/mksh/Build.sh,v 1.98 2007/01/12 01:44:32 tg Exp $
|
# $MirOS: src/bin/mksh/Build.sh,v 1.99 2007/01/12 01:49:26 tg Exp $
|
||||||
#-
|
#-
|
||||||
# Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF
|
# Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF
|
||||||
# With -x: SRCS (extra), TARGET_OS (uname -s)
|
# With -x: SRCS (extra), TARGET_OS (uname -s)
|
||||||
|
|
||||||
# XXX TODO: check for __attribute__ (Minix 3 ACK probably doesn't)
|
|
||||||
# and other gccisms in the code, handle appropriately. Note that I
|
|
||||||
# sometimes _want_ gccisms, because of the improved error checks.
|
|
||||||
|
|
||||||
# XXX TODO: check for $CPP -dD and if that works
|
|
||||||
|
|
||||||
v()
|
v()
|
||||||
{
|
{
|
||||||
$e "$*"
|
$e "$*"
|
||||||
@ -180,6 +174,38 @@ ac_testn can_wnoerror '' "if '$NOWARN' can be used" <<-'EOF'
|
|||||||
EOF
|
EOF
|
||||||
test 1 = $HAVE_CAN_WNOERROR || NOWARN=
|
test 1 = $HAVE_CAN_WNOERROR || NOWARN=
|
||||||
|
|
||||||
|
save_NOWARN=$NOWARN
|
||||||
|
NOWARN=-Werror
|
||||||
|
ac_testn can_werror '' "if -Werror can be used" <<-'EOF'
|
||||||
|
int main(void) { return (0); }
|
||||||
|
EOF
|
||||||
|
test 1 = $HAVE_CAN_WERROR || NOWARN=
|
||||||
|
|
||||||
|
ac_test attribute '' 'if we have __attribute__((...)) at all' <<-'EOF'
|
||||||
|
#include <stdlib.h>
|
||||||
|
void fnord(void) __attribute__((noreturn));
|
||||||
|
int main(void) { fnord(); }
|
||||||
|
void fnord(void) { exit(0); }
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ac_test attribute_bounded attribute 0 'for __attribute__((bounded))' <<-'EOF'
|
||||||
|
#include <string.h>
|
||||||
|
int xcopy(const void *, void *, size_t)
|
||||||
|
__attribute__((bounded (buffer, 1, 3)))
|
||||||
|
__attribute__((bounded (buffer, 2, 3)));
|
||||||
|
int main(int ac, char *av[]) { return (xcopy(av[0], av[1], 1)); }
|
||||||
|
int xcopy(const void *s, void *d, size_t n) {
|
||||||
|
memmove(d, s, n); return (n);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ac_test attribute_used attribute 0 'for __attribute__((used))' <<-'EOF'
|
||||||
|
static const char fnord[] __attribute__((used)) = "42";
|
||||||
|
int main(void) { return (0); }
|
||||||
|
EOF
|
||||||
|
|
||||||
|
NOWARN=$save_NOWARN
|
||||||
|
|
||||||
ac_testn mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF'
|
ac_testn mksh_full '' "if we're building without MKSH_SMALL" <<-'EOF'
|
||||||
#ifdef MKSH_SMALL
|
#ifdef MKSH_SMALL
|
||||||
#error OK, we are building an extra small mksh.
|
#error OK, we are building an extra small mksh.
|
||||||
|
105
edit.c
105
edit.c
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.74 2006/11/19 20:43:12 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.75 2007/01/12 01:49:27 tg Exp $");
|
||||||
|
|
||||||
/* tty driver characters we are interested in */
|
/* tty driver characters we are interested in */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -80,7 +80,7 @@ x_init(void)
|
|||||||
#if defined(TIOCGWINSZ) && defined(SIGWINCH)
|
#if defined(TIOCGWINSZ) && defined(SIGWINCH)
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
x_sigwinch(int sig __attribute__((unused)))
|
x_sigwinch(int sig __unused)
|
||||||
{
|
{
|
||||||
got_sigwinch = 1;
|
got_sigwinch = 1;
|
||||||
}
|
}
|
||||||
@ -280,8 +280,7 @@ x_print_expansions(int nwords, char * const *words, int is_command)
|
|||||||
* - returns number of matching strings
|
* - returns number of matching strings
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
x_file_glob(int flags __attribute__((unused)), const char *str,
|
x_file_glob(int flags __unused, const char *str, int slen, char ***wordsp)
|
||||||
int slen, char ***wordsp)
|
|
||||||
{
|
{
|
||||||
char *toglob;
|
char *toglob;
|
||||||
char **words;
|
char **words;
|
||||||
@ -1629,7 +1628,7 @@ x_emacs_putbuf(const char *s, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_del_back(int c __attribute__((unused)))
|
x_del_back(int c __unused)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@ -1645,7 +1644,7 @@ x_del_back(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_del_char(int c __attribute__((unused)))
|
x_del_char(int c __unused)
|
||||||
{
|
{
|
||||||
char *cp, *cp2;
|
char *cp, *cp2;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -1734,28 +1733,28 @@ x_delete(int nc, int push)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_del_bword(int c __attribute__((unused)))
|
x_del_bword(int c __unused)
|
||||||
{
|
{
|
||||||
x_delete(x_bword(), true);
|
x_delete(x_bword(), true);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_mv_bword(int c __attribute__((unused)))
|
x_mv_bword(int c __unused)
|
||||||
{
|
{
|
||||||
(void)x_bword();
|
(void)x_bword();
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_mv_fword(int c __attribute__((unused)))
|
x_mv_fword(int c __unused)
|
||||||
{
|
{
|
||||||
x_fword(1);
|
x_fword(1);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_del_fword(int c __attribute__((unused)))
|
x_del_fword(int c __unused)
|
||||||
{
|
{
|
||||||
x_delete(x_fword(0), true);
|
x_delete(x_fword(0), true);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
@ -1909,7 +1908,7 @@ x_zotc3(char **cp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_mv_back(int c __attribute__((unused)))
|
x_mv_back(int c __unused)
|
||||||
{
|
{
|
||||||
if (xcp == xbuf) {
|
if (xcp == xbuf) {
|
||||||
x_e_putc2(7);
|
x_e_putc2(7);
|
||||||
@ -1924,7 +1923,7 @@ x_mv_back(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_mv_forw(int c __attribute__((unused)))
|
x_mv_forw(int c __unused)
|
||||||
{
|
{
|
||||||
char *cp = xcp, *cp2;
|
char *cp = xcp, *cp2;
|
||||||
|
|
||||||
@ -1943,7 +1942,7 @@ x_mv_forw(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_search_char_forw(int c __attribute__((unused)))
|
x_search_char_forw(int c __unused)
|
||||||
{
|
{
|
||||||
char *cp = xcp;
|
char *cp = xcp;
|
||||||
char tmp[4];
|
char tmp[4];
|
||||||
@ -1965,7 +1964,7 @@ x_search_char_forw(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_search_char_back(int c __attribute__((unused)))
|
x_search_char_back(int c __unused)
|
||||||
{
|
{
|
||||||
char *cp = xcp, *p;
|
char *cp = xcp, *p;
|
||||||
char tmp[4];
|
char tmp[4];
|
||||||
@ -2001,7 +2000,7 @@ x_search_char_back(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_newline(int c __attribute__((unused)))
|
x_newline(int c __unused)
|
||||||
{
|
{
|
||||||
x_e_putc2('\r');
|
x_e_putc2('\r');
|
||||||
x_e_putc2('\n');
|
x_e_putc2('\n');
|
||||||
@ -2011,7 +2010,7 @@ x_newline(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_end_of_text(int c __attribute__((unused)))
|
x_end_of_text(int c __unused)
|
||||||
{
|
{
|
||||||
x_zotc2(edchars.eof);
|
x_zotc2(edchars.eof);
|
||||||
x_putc('\r');
|
x_putc('\r');
|
||||||
@ -2021,28 +2020,28 @@ x_end_of_text(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_beg_hist(int c __attribute__((unused)))
|
x_beg_hist(int c __unused)
|
||||||
{
|
{
|
||||||
x_load_hist(history);
|
x_load_hist(history);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_end_hist(int c __attribute__((unused)))
|
x_end_hist(int c __unused)
|
||||||
{
|
{
|
||||||
x_load_hist(histptr);
|
x_load_hist(histptr);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_prev_com(int c __attribute__((unused)))
|
x_prev_com(int c __unused)
|
||||||
{
|
{
|
||||||
x_load_hist(x_histp - x_arg);
|
x_load_hist(x_histp - x_arg);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_next_com(int c __attribute__((unused)))
|
x_next_com(int c __unused)
|
||||||
{
|
{
|
||||||
x_load_hist(x_histp + x_arg);
|
x_load_hist(x_histp + x_arg);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
@ -2053,7 +2052,7 @@ x_next_com(int c __attribute__((unused)))
|
|||||||
* want so we'll simply go to the oldest one.
|
* want so we'll simply go to the oldest one.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
x_goto_hist(int c __attribute__((unused)))
|
x_goto_hist(int c __unused)
|
||||||
{
|
{
|
||||||
if (x_arg_defaulted)
|
if (x_arg_defaulted)
|
||||||
x_load_hist(history);
|
x_load_hist(history);
|
||||||
@ -2202,7 +2201,7 @@ x_match(char *str, char *pat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_del_line(int c __attribute__((unused)))
|
x_del_line(int c __unused)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -2220,21 +2219,21 @@ x_del_line(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_mv_end(int c __attribute__((unused)))
|
x_mv_end(int c __unused)
|
||||||
{
|
{
|
||||||
x_goto(xep);
|
x_goto(xep);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_mv_begin(int c __attribute__((unused)))
|
x_mv_begin(int c __unused)
|
||||||
{
|
{
|
||||||
x_goto(xbuf);
|
x_goto(xbuf);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_draw_line(int c __attribute__((unused)))
|
x_draw_line(int c __unused)
|
||||||
{
|
{
|
||||||
x_redraw(-1);
|
x_redraw(-1);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
@ -2314,7 +2313,7 @@ x_redraw(int limit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_transpose(int c __attribute__((unused)))
|
x_transpose(int c __unused)
|
||||||
{
|
{
|
||||||
unsigned tmpa, tmpb;
|
unsigned tmpa, tmpb;
|
||||||
|
|
||||||
@ -2378,28 +2377,28 @@ x_transpose(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_literal(int c __attribute__((unused)))
|
x_literal(int c __unused)
|
||||||
{
|
{
|
||||||
x_curprefix = -1;
|
x_curprefix = -1;
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_meta1(int c __attribute__((unused)))
|
x_meta1(int c __unused)
|
||||||
{
|
{
|
||||||
x_curprefix = 1;
|
x_curprefix = 1;
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_meta2(int c __attribute__((unused)))
|
x_meta2(int c __unused)
|
||||||
{
|
{
|
||||||
x_curprefix = 2;
|
x_curprefix = 2;
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_kill(int c __attribute__((unused)))
|
x_kill(int c __unused)
|
||||||
{
|
{
|
||||||
int col = xcp - xbuf;
|
int col = xcp - xbuf;
|
||||||
int lastcol = xep - xbuf;
|
int lastcol = xep - xbuf;
|
||||||
@ -2429,7 +2428,7 @@ x_push(int nchars)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_yank(int c __attribute__((unused)))
|
x_yank(int c __unused)
|
||||||
{
|
{
|
||||||
if (killsp == 0)
|
if (killsp == 0)
|
||||||
killtp = KILLSIZE;
|
killtp = KILLSIZE;
|
||||||
@ -2447,7 +2446,7 @@ x_yank(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_meta_yank(int c __attribute__((unused)))
|
x_meta_yank(int c __unused)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
if ((x_last_command != XFUNC_yank && x_last_command != XFUNC_meta_yank) ||
|
if ((x_last_command != XFUNC_yank && x_last_command != XFUNC_meta_yank) ||
|
||||||
@ -2471,7 +2470,7 @@ x_meta_yank(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_abort(int c __attribute__((unused)))
|
x_abort(int c __unused)
|
||||||
{
|
{
|
||||||
/* x_zotc(c); */
|
/* x_zotc(c); */
|
||||||
xlp = xep = xcp = xbp = xbuf;
|
xlp = xep = xcp = xbp = xbuf;
|
||||||
@ -2481,7 +2480,7 @@ x_abort(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_error(int c __attribute__((unused)))
|
x_error(int c __unused)
|
||||||
{
|
{
|
||||||
x_e_putc2(7);
|
x_e_putc2(7);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
@ -2681,14 +2680,14 @@ bind_if_not_bound(int p, int k, int func)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_set_mark(int c __attribute__((unused)))
|
x_set_mark(int c __unused)
|
||||||
{
|
{
|
||||||
xmp = xcp;
|
xmp = xcp;
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_kill_region(int c __attribute__((unused)))
|
x_kill_region(int c __unused)
|
||||||
{
|
{
|
||||||
int rsize;
|
int rsize;
|
||||||
char *xr;
|
char *xr;
|
||||||
@ -2711,7 +2710,7 @@ x_kill_region(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_xchg_point_mark(int c __attribute__((unused)))
|
x_xchg_point_mark(int c __unused)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
@ -2726,7 +2725,7 @@ x_xchg_point_mark(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_noop(int c __attribute__((unused)))
|
x_noop(int c __unused)
|
||||||
{
|
{
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
@ -2735,56 +2734,56 @@ x_noop(int c __attribute__((unused)))
|
|||||||
* File/command name completion routines
|
* File/command name completion routines
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
x_comp_comm(int c __attribute__((unused)))
|
x_comp_comm(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_COMMAND, CT_COMPLETE);
|
do_complete(XCF_COMMAND, CT_COMPLETE);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_list_comm(int c __attribute__((unused)))
|
x_list_comm(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_COMMAND, CT_LIST);
|
do_complete(XCF_COMMAND, CT_LIST);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_complete(int c __attribute__((unused)))
|
x_complete(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_COMMAND_FILE, CT_COMPLETE);
|
do_complete(XCF_COMMAND_FILE, CT_COMPLETE);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_enumerate(int c __attribute__((unused)))
|
x_enumerate(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_COMMAND_FILE, CT_LIST);
|
do_complete(XCF_COMMAND_FILE, CT_LIST);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_comp_file(int c __attribute__((unused)))
|
x_comp_file(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_FILE, CT_COMPLETE);
|
do_complete(XCF_FILE, CT_COMPLETE);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_list_file(int c __attribute__((unused)))
|
x_list_file(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_FILE, CT_LIST);
|
do_complete(XCF_FILE, CT_LIST);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_comp_list(int c __attribute__((unused)))
|
x_comp_list(int c __unused)
|
||||||
{
|
{
|
||||||
do_complete(XCF_COMMAND_FILE, CT_COMPLIST);
|
do_complete(XCF_COMMAND_FILE, CT_COMPLIST);
|
||||||
return KSTD;
|
return KSTD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_expand(int c __attribute__((unused)))
|
x_expand(int c __unused)
|
||||||
{
|
{
|
||||||
char **words;
|
char **words;
|
||||||
int nwords = 0;
|
int nwords = 0;
|
||||||
@ -3036,7 +3035,7 @@ x_set_arg(int c)
|
|||||||
|
|
||||||
/* Comment or uncomment the current line. */
|
/* Comment or uncomment the current line. */
|
||||||
static int
|
static int
|
||||||
x_comment(int c __attribute__((unused)))
|
x_comment(int c __unused)
|
||||||
{
|
{
|
||||||
int oldsize = x_size_str(xbuf);
|
int oldsize = x_size_str(xbuf);
|
||||||
int len = xep - xbuf;
|
int len = xep - xbuf;
|
||||||
@ -3056,7 +3055,7 @@ x_comment(int c __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
x_version(int c __attribute__((unused)))
|
x_version(int c __unused)
|
||||||
{
|
{
|
||||||
char *o_xbuf = xbuf, *o_xend = xend;
|
char *o_xbuf = xbuf, *o_xend = xend;
|
||||||
char *o_xbp = xbp, *o_xep = xep, *o_xcp = xcp;
|
char *o_xbp = xbp, *o_xep = xep, *o_xcp = xcp;
|
||||||
@ -3102,7 +3101,7 @@ x_version(int c __attribute__((unused)))
|
|||||||
* KSTD
|
* KSTD
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
x_prev_histword(int c __attribute__((unused)))
|
x_prev_histword(int c __unused)
|
||||||
{
|
{
|
||||||
char *rcp;
|
char *rcp;
|
||||||
char *cp;
|
char *cp;
|
||||||
@ -3150,21 +3149,21 @@ x_prev_histword(int c __attribute__((unused)))
|
|||||||
|
|
||||||
/* Uppercase N(1) words */
|
/* Uppercase N(1) words */
|
||||||
static int
|
static int
|
||||||
x_fold_upper(int c __attribute__((unused)))
|
x_fold_upper(int c __unused)
|
||||||
{
|
{
|
||||||
return x_fold_case('U');
|
return x_fold_case('U');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lowercase N(1) words */
|
/* Lowercase N(1) words */
|
||||||
static int
|
static int
|
||||||
x_fold_lower(int c __attribute__((unused)))
|
x_fold_lower(int c __unused)
|
||||||
{
|
{
|
||||||
return x_fold_case('L');
|
return x_fold_case('L');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lowercase N(1) words */
|
/* Lowercase N(1) words */
|
||||||
static int
|
static int
|
||||||
x_fold_capitalize(int c __attribute__((unused)))
|
x_fold_capitalize(int c __unused)
|
||||||
{
|
{
|
||||||
return x_fold_case('C');
|
return x_fold_case('C');
|
||||||
}
|
}
|
||||||
@ -5349,7 +5348,7 @@ complete_word(int cmd, int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
print_expansions(struct edstate *est, int cmd __attribute__((unused)))
|
print_expansions(struct edstate *est, int cmd __unused)
|
||||||
{
|
{
|
||||||
int nwords;
|
int nwords;
|
||||||
int start, end;
|
int start, end;
|
||||||
|
4
exec.c
4
exec.c
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.20 2006/11/12 14:58:14 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.21 2007/01/12 01:49:27 tg Exp $");
|
||||||
|
|
||||||
static int comexec(struct op *, struct tbl *volatile, char **,
|
static int comexec(struct op *, struct tbl *volatile, char **,
|
||||||
int volatile);
|
int volatile);
|
||||||
static void scriptexec(struct op *, char **) __attribute__((noreturn));
|
static void scriptexec(struct op *, char **) __dead;
|
||||||
static int call_builtin(struct tbl *, char **);
|
static int call_builtin(struct tbl *, char **);
|
||||||
static int iosetup(struct ioword *, struct tbl *);
|
static int iosetup(struct ioword *, struct tbl *);
|
||||||
static int herein(const char *, int);
|
static int herein(const char *, int);
|
||||||
|
5
expr.c
5
expr.c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.6 2006/11/10 07:52:02 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.7 2007/01/12 01:49:27 tg Exp $");
|
||||||
|
|
||||||
/* The order of these enums is constrained by the order of opinfo[] */
|
/* The order of these enums is constrained by the order of opinfo[] */
|
||||||
enum token {
|
enum token {
|
||||||
@ -126,8 +126,7 @@ enum error_type {
|
|||||||
ET_LVALUE, ET_RDONLY, ET_STR
|
ET_LVALUE, ET_RDONLY, ET_STR
|
||||||
};
|
};
|
||||||
|
|
||||||
static void evalerr(Expr_state *, enum error_type, const char *)
|
static __dead void evalerr(Expr_state *, enum error_type, const char *);
|
||||||
__attribute__((__noreturn__));
|
|
||||||
static struct tbl *evalexpr(Expr_state *, enum prec);
|
static struct tbl *evalexpr(Expr_state *, enum prec);
|
||||||
static void token(Expr_state *);
|
static void token(Expr_state *);
|
||||||
static struct tbl *do_ppmm(Expr_state *, enum token, struct tbl *, bool);
|
static struct tbl *do_ppmm(Expr_state *, enum token, struct tbl *, bool);
|
||||||
|
10
funcs.c
10
funcs.c
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.41 2007/01/12 00:25:39 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.42 2007/01/12 01:49:28 tg Exp $");
|
||||||
|
|
||||||
int
|
int
|
||||||
c_cd(char **wp)
|
c_cd(char **wp)
|
||||||
@ -2042,7 +2042,7 @@ p_time(struct shf *shf, int posix, struct timeval *tv, int width,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
c_times(char **wp __attribute__((unused)))
|
c_times(char **wp __unused)
|
||||||
{
|
{
|
||||||
struct rusage usage;
|
struct rusage usage;
|
||||||
|
|
||||||
@ -2172,7 +2172,7 @@ timex_hook(struct op *t, char **volatile *app)
|
|||||||
|
|
||||||
/* exec with no args - args case is taken care of in comexec() */
|
/* exec with no args - args case is taken care of in comexec() */
|
||||||
int
|
int
|
||||||
c_exec(char **wp __attribute__((unused)))
|
c_exec(char **wp __unused)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -2278,7 +2278,7 @@ c_mknod(char **wp)
|
|||||||
|
|
||||||
/* dummy function, special case in comexec() */
|
/* dummy function, special case in comexec() */
|
||||||
int
|
int
|
||||||
c_builtin(char **wp __attribute__((unused)))
|
c_builtin(char **wp __unused)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2803,7 +2803,7 @@ ptest_isa(Test_env *te, Test_meta meta)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
ptest_getopnd(Test_env *te, Test_op op, int do_eval __attribute__((unused)))
|
ptest_getopnd(Test_env *te, Test_op op, int do_eval __unused)
|
||||||
{
|
{
|
||||||
if (te->pos.wp >= te->wp_end)
|
if (te->pos.wp >= te->wp_end)
|
||||||
return op == TO_FILTT ? "1" : NULL;
|
return op == TO_FILTT ? "1" : NULL;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.37 2007/01/12 01:30:35 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.38 2007/01/12 01:49:28 tg Exp $");
|
||||||
|
|
||||||
Trap sigtraps[NSIG + 1];
|
Trap sigtraps[NSIG + 1];
|
||||||
static struct sigaction Sigact_ign, Sigact_trap;
|
static struct sigaction Sigact_ign, Sigact_trap;
|
||||||
@ -564,8 +564,7 @@ init_histvec(void)
|
|||||||
* save command in history
|
* save command in history
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
histsave(int lno __attribute__((unused)), const char *cmd,
|
histsave(int lno __unused, const char *cmd, int dowrite __unused)
|
||||||
int dowrite __attribute__((unused)))
|
|
||||||
{
|
{
|
||||||
char **hp;
|
char **hp;
|
||||||
char *c, *cp;
|
char *c, *cp;
|
||||||
@ -1037,7 +1036,7 @@ alarm_init(void)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
alarm_catcher(int sig __attribute__((unused)))
|
alarm_catcher(int sig __unused)
|
||||||
{
|
{
|
||||||
int errno_ = errno;
|
int errno_ = errno;
|
||||||
|
|
||||||
|
4
jobs.c
4
jobs.c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.16 2006/11/12 13:20:15 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.17 2007/01/12 01:49:28 tg Exp $");
|
||||||
|
|
||||||
/* Order important! */
|
/* Order important! */
|
||||||
#define PRUNNING 0
|
#define PRUNNING 0
|
||||||
@ -1012,7 +1012,7 @@ j_waitj(Job *j,
|
|||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
j_sigchld(int sig __attribute__((unused)))
|
j_sigchld(int sig __unused)
|
||||||
{
|
{
|
||||||
int errno_ = errno;
|
int errno_ = errno;
|
||||||
Job *j;
|
Job *j;
|
||||||
|
57
sh.h
57
sh.h
@ -8,7 +8,7 @@
|
|||||||
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
|
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
|
||||||
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
|
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
|
||||||
|
|
||||||
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.93 2007/01/12 00:25:40 tg Exp $"
|
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.94 2007/01/12 01:49:28 tg Exp $"
|
||||||
#define MKSH_VERSION "R29 2007/01/12"
|
#define MKSH_VERSION "R29 2007/01/12"
|
||||||
|
|
||||||
#if HAVE_SYS_PARAM_H
|
#if HAVE_SYS_PARAM_H
|
||||||
@ -16,19 +16,21 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if !defined(__RCSID) || !defined(__SCCSID)
|
#if !defined(__RCSID) || !defined(__SCCSID)
|
||||||
#if !defined(__GNUC__) || defined(lint)
|
|
||||||
#define __attribute__(x) /* deleted */
|
|
||||||
#endif
|
|
||||||
#undef __IDSTRING
|
#undef __IDSTRING
|
||||||
#undef __IDSTRING_CONCAT
|
#undef __IDSTRING_CONCAT
|
||||||
#undef __IDSTRING_EXPAND
|
#undef __IDSTRING_EXPAND
|
||||||
#undef __RCSID
|
#undef __RCSID
|
||||||
#undef __SCCSID
|
#undef __SCCSID
|
||||||
|
#if HAVE_ATTRIBUTE_USED
|
||||||
|
#define __attribute____used__ __attribute__((used))
|
||||||
|
#else
|
||||||
|
#define __attribute____used__ /* nothing */
|
||||||
|
#endif
|
||||||
#define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
|
#define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
|
||||||
#define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
|
#define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
|
||||||
#define __IDSTRING(prefix, string) \
|
#define __IDSTRING(prefix, string) \
|
||||||
static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \
|
static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \
|
||||||
__attribute__((used)) = "@(""#)" #prefix ": " string
|
__attribute____used__ = "@(""#)" #prefix ": " string
|
||||||
#define __RCSID(x) __IDSTRING(rcsid,x)
|
#define __RCSID(x) __IDSTRING(rcsid,x)
|
||||||
#define __SCCSID(x) __IDSTRING(sccsid,x)
|
#define __SCCSID(x) __IDSTRING(sccsid,x)
|
||||||
#endif
|
#endif
|
||||||
@ -104,6 +106,21 @@
|
|||||||
#define ksh_tolower(c) (((c) >= 'A') && ((c) <= 'Z') ? (c) - 'A' + 'a' : (c))
|
#define ksh_tolower(c) (((c) >= 'A') && ((c) <= 'Z') ? (c) - 'A' + 'a' : (c))
|
||||||
#define ksh_toupper(c) (((c) >= 'a') && ((c) <= 'z') ? (c) - 'a' + 'A' : (c))
|
#define ksh_toupper(c) (((c) >= 'a') && ((c) <= 'z') ? (c) - 'a' + 'A' : (c))
|
||||||
|
|
||||||
|
#if HAVE_ATTRIBUTE
|
||||||
|
#undef __attribute__
|
||||||
|
#if HAVE_ATTRIBUTE_BOUNDED
|
||||||
|
#define __bound_att__ __attribute__
|
||||||
|
#else
|
||||||
|
#define __bound_att(x) /* nothing */
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define __attribute__(x) /* nothing */
|
||||||
|
#endif
|
||||||
|
#undef __dead
|
||||||
|
#define __dead __attribute__((noreturn))
|
||||||
|
#undef __unused
|
||||||
|
#define __unused __attribute__((unused))
|
||||||
|
|
||||||
/* this macro must not evaluate its arguments several times */
|
/* this macro must not evaluate its arguments several times */
|
||||||
#define ksh_isspace(c) __extension__({ \
|
#define ksh_isspace(c) __extension__({ \
|
||||||
unsigned char ksh_isspace_c = (c); \
|
unsigned char ksh_isspace_c = (c); \
|
||||||
@ -1182,8 +1199,8 @@ pid_t j_async(void);
|
|||||||
int j_stopped_running(void);
|
int j_stopped_running(void);
|
||||||
/* lex.c */
|
/* lex.c */
|
||||||
int yylex(int);
|
int yylex(int);
|
||||||
void yyerror(const char *, ...)
|
__dead void yyerror(const char *, ...)
|
||||||
__attribute__((__noreturn__, __format__ (printf, 1, 2)));
|
__attribute__((format (printf, 1, 2)));
|
||||||
Source *pushs(int, Area *);
|
Source *pushs(int, Area *);
|
||||||
void set_prompt(int, Source *);
|
void set_prompt(int, Source *);
|
||||||
void pprompt(const char *, int);
|
void pprompt(const char *, int);
|
||||||
@ -1192,24 +1209,24 @@ int promptlen(const char *);
|
|||||||
int include(const char *, int, char **, int);
|
int include(const char *, int, char **, int);
|
||||||
int command(const char *);
|
int command(const char *);
|
||||||
int shell(Source *volatile, int volatile);
|
int shell(Source *volatile, int volatile);
|
||||||
void unwind(int) __attribute__((__noreturn__));
|
__dead void unwind(int);
|
||||||
void newenv(int);
|
void newenv(int);
|
||||||
void quitenv(struct shf *);
|
void quitenv(struct shf *);
|
||||||
void cleanup_parents_env(void);
|
void cleanup_parents_env(void);
|
||||||
void cleanup_proc_env(void);
|
void cleanup_proc_env(void);
|
||||||
void errorf(const char *, ...)
|
__dead void errorf(const char *, ...)
|
||||||
__attribute__((__noreturn__, __format__ (printf, 1, 2)));
|
__attribute__((format (printf, 1, 2)));
|
||||||
void warningf(bool, const char *, ...)
|
void warningf(bool, const char *, ...)
|
||||||
__attribute__((__format__ (printf, 2, 3)));
|
__attribute__((format (printf, 2, 3)));
|
||||||
void bi_errorf(const char *, ...)
|
void bi_errorf(const char *, ...)
|
||||||
__attribute__((__format__ (printf, 1, 2)));
|
__attribute__((format (printf, 1, 2)));
|
||||||
void internal_errorf(int, const char *, ...)
|
void internal_errorf(int, const char *, ...)
|
||||||
__attribute__((__format__ (printf, 2, 3)));
|
__attribute__((format (printf, 2, 3)));
|
||||||
void error_prefix(bool);
|
void error_prefix(bool);
|
||||||
void shellf(const char *, ...)
|
void shellf(const char *, ...)
|
||||||
__attribute__((__format__ (printf, 1, 2)));
|
__attribute__((format (printf, 1, 2)));
|
||||||
void shprintf(const char *, ...)
|
void shprintf(const char *, ...)
|
||||||
__attribute__((__format__ (printf, 1, 2)));
|
__attribute__((format (printf, 1, 2)));
|
||||||
int can_seek(int);
|
int can_seek(int);
|
||||||
void initio(void);
|
void initio(void);
|
||||||
int ksh_dup2(int, int, int);
|
int ksh_dup2(int, int, int);
|
||||||
@ -1283,14 +1300,14 @@ int shf_putchar(int, struct shf *);
|
|||||||
int shf_puts(const char *, struct shf *);
|
int shf_puts(const char *, struct shf *);
|
||||||
int shf_write(const char *, int, struct shf *);
|
int shf_write(const char *, int, struct shf *);
|
||||||
int shf_fprintf(struct shf *, const char *, ...)
|
int shf_fprintf(struct shf *, const char *, ...)
|
||||||
__attribute__((__format__ (printf, 2, 3)));
|
__attribute__((format (printf, 2, 3)));
|
||||||
int shf_snprintf(char *, int, const char *, ...)
|
int shf_snprintf(char *, int, const char *, ...)
|
||||||
__attribute__((__format__ (printf, 3, 4)))
|
__attribute__((format (printf, 3, 4)))
|
||||||
__attribute__((__bounded__ (__string__,1,2)));
|
__bound_att__((bounded (string, 1, 2)));
|
||||||
char *shf_smprintf(const char *, ...)
|
char *shf_smprintf(const char *, ...)
|
||||||
__attribute__((__format__ (printf, 1, 2)));
|
__attribute__((format (printf, 1, 2)));
|
||||||
int shf_vfprintf(struct shf *, const char *, va_list)
|
int shf_vfprintf(struct shf *, const char *, va_list)
|
||||||
__attribute__((__format__ (printf, 2, 0)));
|
__attribute__((format (printf, 2, 0)));
|
||||||
/* syn.c */
|
/* syn.c */
|
||||||
void initkeywords(void);
|
void initkeywords(void);
|
||||||
struct op *compile(Source *);
|
struct op *compile(Source *);
|
||||||
|
24
strlfun.c
24
strlfun.c
@ -1,4 +1,4 @@
|
|||||||
/* $MirOS: src/bin/mksh/strlfun.c,v 1.8 2007/01/09 17:34:21 tg Exp $ */
|
/* $MirOS: src/bin/mksh/strlfun.c,v 1.9 2007/01/12 01:49:29 tg Exp $ */
|
||||||
/* $miros: src/lib/libc/string/strlfun.c,v 1.14 2007/01/07 02:11:40 tg Exp $ */
|
/* $miros: src/lib/libc/string/strlfun.c,v 1.14 2007/01/07 02:11:40 tg Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
@ -45,26 +45,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __RCSID
|
|
||||||
#undef __IDSTRING
|
|
||||||
#undef __IDSTRING_CONCAT
|
|
||||||
#undef __IDSTRING_EXPAND
|
|
||||||
#if defined(__ELF__) && defined(__GNUC__)
|
|
||||||
#define __IDSTRING(prefix, string) \
|
|
||||||
__asm__(".section .comment" \
|
|
||||||
"\n .ascii \"@(\"\"#)" #prefix ": \"" \
|
|
||||||
"\n .asciz \"" string "\"" \
|
|
||||||
"\n .previous")
|
|
||||||
#else
|
|
||||||
#define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p
|
|
||||||
#define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p)
|
|
||||||
#define __IDSTRING(prefix, string) \
|
|
||||||
static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \
|
|
||||||
__attribute__((used)) = "@(""#)" #prefix ": " string
|
|
||||||
#endif
|
|
||||||
#define __RCSID(x) __IDSTRING(rcsid,x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __predict_true
|
#ifndef __predict_true
|
||||||
#define __predict_true(exp) ((exp) != 0)
|
#define __predict_true(exp) ((exp) != 0)
|
||||||
#endif
|
#endif
|
||||||
@ -73,7 +53,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||||
__RCSID("$MirOS: src/bin/mksh/strlfun.c,v 1.8 2007/01/09 17:34:21 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/strlfun.c,v 1.9 2007/01/12 01:49:29 tg Exp $");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
size_t strlcpy(char *, const char *, size_t);
|
size_t strlcpy(char *, const char *, size_t);
|
||||||
|
27
syn.c
27
syn.c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#include "sh.h"
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.8 2006/08/01 13:43:28 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.9 2007/01/12 01:49:29 tg Exp $");
|
||||||
|
|
||||||
struct nesting_state {
|
struct nesting_state {
|
||||||
int start_token; /* token than began nesting (eg, FOR) */
|
int start_token; /* token than began nesting (eg, FOR) */
|
||||||
@ -23,10 +23,10 @@ static struct op *elsepart(void);
|
|||||||
static struct op *caselist(void);
|
static struct op *caselist(void);
|
||||||
static struct op *casepart(int);
|
static struct op *casepart(int);
|
||||||
static struct op *function_body(char *, int);
|
static struct op *function_body(char *, int);
|
||||||
static char ** wordlist(void);
|
static char **wordlist(void);
|
||||||
static struct op *block(int, struct op *, struct op *, char **);
|
static struct op *block(int, struct op *, struct op *, char **);
|
||||||
static struct op *newtp(int);
|
static struct op *newtp(int);
|
||||||
static void syntaxerr(const char *) __attribute__((__noreturn__));
|
static __dead void syntaxerr(const char *);
|
||||||
static void nesting_push(struct nesting_state *, int);
|
static void nesting_push(struct nesting_state *, int);
|
||||||
static void nesting_pop(struct nesting_state *);
|
static void nesting_pop(struct nesting_state *);
|
||||||
static int assign_command(char *);
|
static int assign_command(char *);
|
||||||
@ -35,11 +35,9 @@ static int dbtestp_isa(Test_env *, Test_meta);
|
|||||||
static const char *dbtestp_getopnd(Test_env *, Test_op, int);
|
static const char *dbtestp_getopnd(Test_env *, Test_op, int);
|
||||||
static int dbtestp_eval(Test_env *, Test_op, const char *,
|
static int dbtestp_eval(Test_env *, Test_op, const char *,
|
||||||
const char *, int);
|
const char *, int);
|
||||||
static void dbtestp_error(Test_env *, int, const char *)
|
static __dead void dbtestp_error(Test_env *, int, const char *);
|
||||||
__attribute__((noreturn));
|
|
||||||
|
|
||||||
static struct op *outtree; /* yyparse output */
|
static struct op *outtree; /* yyparse output */
|
||||||
|
|
||||||
static struct nesting_state nesting; /* \n changed to ; */
|
static struct nesting_state nesting; /* \n changed to ; */
|
||||||
|
|
||||||
static int reject; /* token(cf) gets symbol again */
|
static int reject; /* token(cf) gets symbol again */
|
||||||
@ -47,10 +45,8 @@ static int symbol; /* yylex value */
|
|||||||
|
|
||||||
#define REJECT (reject = 1)
|
#define REJECT (reject = 1)
|
||||||
#define ACCEPT (reject = 0)
|
#define ACCEPT (reject = 0)
|
||||||
#define token(cf) \
|
#define token(cf) ((reject) ? (ACCEPT, symbol) : (symbol = yylex(cf)))
|
||||||
((reject) ? (ACCEPT, symbol) : (symbol = yylex(cf)))
|
#define tpeek(cf) ((reject) ? (symbol) : (REJECT, symbol = yylex(cf)))
|
||||||
#define tpeek(cf) \
|
|
||||||
((reject) ? (symbol) : (REJECT, symbol = yylex(cf)))
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
yyparse(void)
|
yyparse(void)
|
||||||
@ -859,8 +855,7 @@ dbtestp_isa(Test_env *te, Test_meta meta)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
dbtestp_getopnd(Test_env *te, Test_op op __attribute__((unused)),
|
dbtestp_getopnd(Test_env *te, Test_op op __unused, int do_eval __unused)
|
||||||
int do_eval __attribute__((unused)))
|
|
||||||
{
|
{
|
||||||
int c = tpeek(ARRAYVAR);
|
int c = tpeek(ARRAYVAR);
|
||||||
|
|
||||||
@ -874,11 +869,9 @@ dbtestp_getopnd(Test_env *te, Test_op op __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dbtestp_eval(Test_env *te __attribute__((unused)),
|
dbtestp_eval(Test_env *te __unused, Test_op op __unused,
|
||||||
Test_op op __attribute__((unused)),
|
const char *opnd1 __unused, const char *opnd2 __unused,
|
||||||
const char *opnd1 __attribute__((unused)),
|
int do_eval __unused)
|
||||||
const char *opnd2 __attribute__((unused)),
|
|
||||||
int do_eval __attribute__((unused)))
|
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user