diff options
| author | Dan McDonald <danmcd@joyent.com> | 2021-11-17 23:41:50 -0500 |
|---|---|---|
| committer | Dan McDonald <danmcd@joyent.com> | 2021-11-17 23:41:50 -0500 |
| commit | fb06a756a0ecba732e1563d1f6085aa2b0741bec (patch) | |
| tree | 3e414948336dbfcc99e7d4b8b6ea285c687877e9 /usr/src/tools/cw | |
| parent | 1527789b01d8a7138dff5e0f64ccacb204d7d11f (diff) | |
| parent | b01ccfc756001a8958d2e91fcd4e48f30456b2ef (diff) | |
| download | illumos-joyent-fb06a756a0ecba732e1563d1f6085aa2b0741bec.tar.gz | |
[illumos-gate merge]
commit b01ccfc756001a8958d2e91fcd4e48f30456b2ef
14244 chunks of protocmp escaped into pkg:/system/test/elftest
commit 2c4055ebe2826777af400387612994d8bf26d113
14209 partial support for new relaxable relocations
commit a530dbfeb9a5dac77444604360c346085f7c7a04
14207 want updated ELF relocation definitions from the psABI
commit 31116d9acef4a8c61f08e5ae089e2d29f233988d
14162 zfs-tests: document pre-requisites
commit 22a8b493c14c29001395d6df0b6fe6bb52d36947
14219 cw: clang does not like B_FALSE/B_TRUE with c99
Diffstat (limited to 'usr/src/tools/cw')
| -rw-r--r-- | usr/src/tools/cw/Makefile | 5 | ||||
| -rw-r--r-- | usr/src/tools/cw/cw.c | 35 |
2 files changed, 19 insertions, 21 deletions
diff --git a/usr/src/tools/cw/Makefile b/usr/src/tools/cw/Makefile index af5dab8c6e..a3f2f8faa0 100644 --- a/usr/src/tools/cw/Makefile +++ b/usr/src/tools/cw/Makefile @@ -39,8 +39,7 @@ $(__GNUC)sparc_CC= $(GNUC_ROOT)/bin/gcc CFLAGS += $(CCVERBOSE) # Override CFLAGS. This is needed only for bootstrap of cw. -$(__GNUC)CFLAGS= -O -D__sun -Wall -Wno-unknown-pragmas -Werror \ - -std=gnu99 -nodefaultlibs +$(__GNUC)CFLAGS= -O -D__sun -Wall -Werror -std=gnu99 -nodefaultlibs $(__SUNC)CFLAGS= -xspace -Xa -xildoff -errtags=yes -errwarn=%all \ -xc99=%all -W0,-xglobalstatic -v @@ -63,8 +62,6 @@ all: $(PROG) $(MAN1ONBLDFILES) install: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES) -lint: lint_PROG - clean: # diff --git a/usr/src/tools/cw/cw.c b/usr/src/tools/cw/cw.c index ccd520207b..bdfdccbc70 100644 --- a/usr/src/tools/cw/cw.c +++ b/usr/src/tools/cw/cw.c @@ -39,7 +39,7 @@ */ /* If you modify this file, you must increment CW_VERSION */ -#define CW_VERSION "5.0" +#define CW_VERSION "5.1" /* * -# Verbose mode @@ -253,6 +253,7 @@ #include <getopt.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <unistd.h> #include <dirent.h> @@ -588,13 +589,13 @@ discard_file_name(cw_ictx_t *ctx, const char *path) return (ret); } -static boolean_t +static bool is_source_file(const char *path) { char *ext = strrchr(path, '.'); if ((ext == NULL) || (*(ext + 1) == '\0')) - return (B_FALSE); + return (false); ext += 1; @@ -603,10 +604,10 @@ is_source_file(const char *path) (strcmp(ext, "i") == 0) || (strcasecmp(ext, "s") == 0) || (strcmp(ext, "cpp") == 0)) { - return (B_TRUE); + return (true); } - return (B_FALSE); + return (false); } @@ -1687,12 +1688,12 @@ main(int argc, char **argv) cw_compiler_t shadows[10]; int nshadows = 0; int ret = 0; - boolean_t do_serial = B_FALSE; - boolean_t do_exec = B_FALSE; - boolean_t vflg = B_FALSE; - boolean_t Cflg = B_FALSE; - boolean_t cflg = B_FALSE; - boolean_t nflg = B_FALSE; + bool do_serial; + bool do_exec; + bool vflg = false; + bool Cflg = false; + bool cflg = false; + bool nflg = false; char *tmpdir; cw_ictx_t *main_ctx; @@ -1714,17 +1715,17 @@ main(int argc, char **argv) while ((ch = getopt_long(argc, argv, "C", longopts, NULL)) != -1) { switch (ch) { case 'c': - cflg = B_TRUE; + cflg = true; break; case 'C': - Cflg = B_TRUE; + Cflg = true; break; case 'l': if ((main_ctx->i_linker = strdup(optarg)) == NULL) nomem(); break; case 'n': - nflg = B_TRUE; + nflg = true; break; case 'p': if (primary.c_path != NULL) { @@ -1743,7 +1744,7 @@ main(int argc, char **argv) nshadows++; break; case 'v': - vflg = B_TRUE; + vflg = true; break; default: (void) fprintf(stderr, "Did you forget '--'?\n"); @@ -1756,8 +1757,8 @@ main(int argc, char **argv) usage(); } - do_serial = (getenv("CW_SHADOW_SERIAL") == NULL) ? B_FALSE : B_TRUE; - do_exec = (getenv("CW_NO_EXEC") == NULL) ? B_TRUE : B_FALSE; + do_serial = getenv("CW_SHADOW_SERIAL") != NULL; + do_exec = getenv("CW_NO_EXEC") == NULL; /* Leave room for argv[0] */ argc -= (optind - 1); |
