Revert some changes to work around ORCA/C issues that have been addressed.

Most of these are trailing commas in enums. There are also a couple preprocessor bug workarounds that are no longer necessary.

As of this version, ORCA/C 2.2.0 B2 or later should be used to compile hush.
This commit is contained in:
Stephen Heumann 2017-12-31 16:27:45 -06:00
parent 99224d3946
commit d610c572f2
10 changed files with 20 additions and 20 deletions

View File

@ -37,7 +37,7 @@ that expect a Bourne-type shell in that location).
Building Building
-------- --------
To build it, you also need ORCA/C 2.1.x and plenty of memory (8MB is enough). To build it, you also need ORCA/C 2.2.x and plenty of memory (8MB is enough).
You also need to have a copy of the ltermcap library from GNO 2.0.4 installed You also need to have a copy of the ltermcap library from GNO 2.0.4 installed
as `/usr/lib/libtermcap.204` (the GNO 2.0.6 version is broken and won't work). as `/usr/lib/libtermcap.204` (the GNO 2.0.6 version is broken and won't work).
Run `make` or (if the source files don't have correct filetypes) `make build`. Run `make` or (if the source files don't have correct filetypes) `make build`.

View File

@ -73,7 +73,7 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
#if !ENABLE_FEATURE_FANCY_ECHO #if !ENABLE_FEATURE_FANCY_ECHO
enum { enum {
eflag = '\\', eflag = '\\',
nflag = 1 /* 1 -- print '\n' */ nflag = 1, /* 1 -- print '\n' */
}; };
argv++; argv++;

View File

@ -382,7 +382,7 @@ enum {
ACTION_DEPTHFIRST = (1 << 3), ACTION_DEPTHFIRST = (1 << 3),
/*ACTION_REVERSE = (1 << 4), - unused */ /*ACTION_REVERSE = (1 << 4), - unused */
ACTION_QUIET = (1 << 5), ACTION_QUIET = (1 << 5),
ACTION_DANGLING_OK = (1 << 6) ACTION_DANGLING_OK = (1 << 6),
}; };
typedef uint8_t recurse_flags_t; typedef uint8_t recurse_flags_t;
extern int recursive_action(const char *fileName, unsigned flags, extern int recursive_action(const char *fileName, unsigned flags,
@ -684,7 +684,7 @@ void fputc_printable(int ch, FILE *file) FAST_FUNC;
* Buffer must hold at least four characters. */ * Buffer must hold at least four characters. */
enum { enum {
VISIBLE_ENDLINE = 1 << 0, VISIBLE_ENDLINE = 1 << 0,
VISIBLE_SHOW_TABS = 1 << 1 VISIBLE_SHOW_TABS = 1 << 1,
}; };
void visible(unsigned ch, char *buf, int flags) FAST_FUNC; void visible(unsigned ch, char *buf, int flags) FAST_FUNC;
@ -974,7 +974,7 @@ enum {
DAEMON_DEVNULL_STDIO = 2, DAEMON_DEVNULL_STDIO = 2,
DAEMON_CLOSE_EXTRA_FDS = 4, DAEMON_CLOSE_EXTRA_FDS = 4,
DAEMON_ONLY_SANITIZE = 8, /* internal use */ DAEMON_ONLY_SANITIZE = 8, /* internal use */
DAEMON_DOUBLE_FORK = 16 /* double fork to avoid controlling tty */ DAEMON_DOUBLE_FORK = 16, /* double fork to avoid controlling tty */
}; };
#if BB_MMU #if BB_MMU
# define fork_or_rexec(argv) xfork() # define fork_or_rexec(argv) xfork()
@ -1435,7 +1435,7 @@ enum {
USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION, USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION,
VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI, VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI,
WITH_PATH_LOOKUP = 0x10, WITH_PATH_LOOKUP = 0x10,
FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION,
}; };
line_input_t *new_line_input_t(int flags) FAST_FUNC; line_input_t *new_line_input_t(int flags) FAST_FUNC;
/* So far static: void free_line_input_t(line_input_t *n) FAST_FUNC; */ /* So far static: void free_line_input_t(line_input_t *n) FAST_FUNC; */

View File

@ -44,9 +44,6 @@
# define __const const # define __const const
#endif #endif
/* used by unit test machinery to run registration functions before calling main() */
#define INIT_FUNC __attribute__ ((constructor))
#define UNUSED_PARAM __attribute__ ((__unused__)) #define UNUSED_PARAM __attribute__ ((__unused__))
#define NORETURN __attribute__ ((__noreturn__)) #define NORETURN __attribute__ ((__noreturn__))
/* "The malloc attribute is used to tell the compiler that a function /* "The malloc attribute is used to tell the compiler that a function
@ -84,6 +81,9 @@
# define UNUSED_PARAM_RESULT # define UNUSED_PARAM_RESULT
#endif #endif
/* used by unit test machinery to run registration functions before calling main() */
#define INIT_FUNC __attribute__ ((constructor))
/* -fwhole-program makes all symbols local. The attribute externally_visible /* -fwhole-program makes all symbols local. The attribute externally_visible
* forces a symbol global. */ * forces a symbol global. */
#if __GNUC_PREREQ(4,1) #if __GNUC_PREREQ(4,1)

View File

@ -15,7 +15,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
enum { enum {
UNICODE_UNKNOWN = 0, UNICODE_UNKNOWN = 0,
UNICODE_OFF = 1, UNICODE_OFF = 1,
UNICODE_ON = 2 UNICODE_ON = 2,
}; };
#define unicode_bidi_isrtl(wc) 0 #define unicode_bidi_isrtl(wc) 0
@ -56,7 +56,7 @@ size_t FAST_FUNC unicode_strlen(const char *string);
/* Width on terminal */ /* Width on terminal */
size_t FAST_FUNC unicode_strwidth(const char *string); size_t FAST_FUNC unicode_strwidth(const char *string);
enum { enum {
UNI_FLAG_PAD = (1 << 0) UNI_FLAG_PAD = (1 << 0),
}; };
//UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src); //UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src);
//UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags); //UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags);

View File

@ -312,7 +312,7 @@ const char *opt_complementary;
enum { enum {
PARAM_STRING, PARAM_STRING,
PARAM_LIST, PARAM_LIST,
PARAM_INT PARAM_INT,
}; };
typedef struct { typedef struct {

View File

@ -845,7 +845,7 @@ static NOINLINE unsigned complete_username(const char *ud)
enum { enum {
FIND_EXE_ONLY = 0, FIND_EXE_ONLY = 0,
FIND_DIR_ONLY = 1, FIND_DIR_ONLY = 1,
FIND_FILE_ONLY = 2 FIND_FILE_ONLY = 2,
}; };
#ifndef __GNO__ #ifndef __GNO__

View File

@ -466,7 +466,7 @@ enum {
EXP_FLAG_GLOB = 0x2, EXP_FLAG_GLOB = 0x2,
/* Protect newly added chars against globbing /* Protect newly added chars against globbing
* by prepending \ to *, ?, [, \ */ * by prepending \ to *, ?, [, \ */
EXP_FLAG_ESC_GLOB_CHARS = 0x1 EXP_FLAG_ESC_GLOB_CHARS = 0x1,
}; };
enum { enum {
MAYBE_ASSIGNMENT = 0, MAYBE_ASSIGNMENT = 0,
@ -546,7 +546,7 @@ typedef enum redir_type {
/* otherwise, rd_fd is redirected to rd_dup */ /* otherwise, rd_fd is redirected to rd_dup */
HEREDOC_SKIPTABS = 1, HEREDOC_SKIPTABS = 1,
HEREDOC_QUOTED = 2 HEREDOC_QUOTED = 2,
} redir_type; } redir_type;
@ -619,7 +619,7 @@ typedef enum pipe_style {
PIPE_SEQ = 1, PIPE_SEQ = 1,
PIPE_AND = 2, PIPE_AND = 2,
PIPE_OR = 3, PIPE_OR = 3,
PIPE_BG = 4 PIPE_BG = 4,
} pipe_style; } pipe_style;
/* Is there anything in this pipe at all? */ /* Is there anything in this pipe at all? */
#define IS_NULL_PIPE(pi) \ #define IS_NULL_PIPE(pi) \
@ -678,7 +678,7 @@ struct variable {
enum { enum {
BC_BREAK = 1, BC_BREAK = 1,
BC_CONTINUE = 2 BC_CONTINUE = 2,
}; };
#if ENABLE_HUSH_FUNCTIONS #if ENABLE_HUSH_FUNCTIONS
@ -7937,7 +7937,7 @@ static int run_list(struct pipe *pi)
} }
} }
last_followup = pi->followup; last_followup = pi->followup;
IF_HAS_KEYWORDS(last_rword = rword); /* ; outside to avoid ORCA/C bug */ IF_HAS_KEYWORDS(last_rword = rword;)
#if ENABLE_HUSH_IF #if ENABLE_HUSH_IF
if (cond_code) { if (cond_code) {
if (rword == RES_THEN) { if (rword == RES_THEN) {

View File

@ -11,7 +11,7 @@ enum {
SCAN_MOVE_FROM_LEFT = (1 << 0), SCAN_MOVE_FROM_LEFT = (1 << 0),
SCAN_MOVE_FROM_RIGHT = (1 << 1), SCAN_MOVE_FROM_RIGHT = (1 << 1),
SCAN_MATCH_LEFT_HALF = (1 << 2), SCAN_MATCH_LEFT_HALF = (1 << 2),
SCAN_MATCH_RIGHT_HALF = (1 << 3) SCAN_MATCH_RIGHT_HALF = (1 << 3),
}; };
char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags); char* FAST_FUNC scan_and_match(char *string, const char *pattern, unsigned flags);

View File

@ -48,7 +48,7 @@ next_random(random_t *rnd)
enum { enum {
a = 2, a = 2,
b = 7, b = 7,
c = 3 c = 3,
}; };
uint32_t t; uint32_t t;