${BDECFLAGS} work. And fix a real error in the process. A "MAXUSERS"

string could have been passed to free();  There are some warnings here
I am not sure how to fix as they are in the lex scanner code, etc.
This commit is contained in:
Peter Wemm 2001-02-19 04:43:21 +00:00
parent 866546105a
commit 68f4fced95
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72684
7 changed files with 21 additions and 21 deletions

View File

@ -3,7 +3,7 @@
PROG= config
CFLAGS+=-I. -I${.CURDIR}
CFLAGS+=-Wall -Wunused -Wmissing-prototypes -Wredundant-decls
CFLAGS+=${BDECFLAGS}
SRCS= config.y main.c lang.l mkmakefile.c mkheaders.c \
mkoptions.c y.tab.h
MAN8= config.8

View File

@ -131,9 +131,9 @@ extern int hintmode;
char *get_word(FILE *);
char *get_quoted_word(FILE *);
char *path(char *);
char *path(const char *);
char *raisestr(char *);
void remember(char *);
void remember(const char *);
void moveifchanged(const char *, const char *);
void newbus_ioconf(void);
int yyparse(void);

View File

@ -84,7 +84,7 @@ int maxusers;
#define ns(s) strdup(s)
static void yyerror(char *s);
static void yyerror(const char *s);
static char *
devopt(char *dev)
@ -283,7 +283,7 @@ Device_spec:
%%
static void
yyerror(char *s)
yyerror(const char *s)
{
errx(1, "line %d: %s", yyline + 1, s);

View File

@ -47,7 +47,7 @@
*/
struct kt {
char *kt_name;
const char *kt_name;
int kt_val;
} key_words[] = {
{ "config", CONFIG },

View File

@ -306,7 +306,7 @@ get_quoted_word(FILE *fp)
* prepend the path to a filename
*/
char *
path(char *file)
path(const char *file)
{
char *cp = NULL;
@ -452,16 +452,15 @@ cleanheaders(char *p)
}
void
remember(char *file)
remember(const char *file)
{
char *s;
struct hdr_list *hl;
if ((s = strrchr(file, '/')) != NULL)
s++;
s = ns(s + 1);
else
s = file;
s = ns(s);
s = ns(file);
if (index(s, '_') && strncmp(s, "opt_", 4) != 0) {
free(s);

View File

@ -77,7 +77,7 @@ static void do_rules(FILE *);
static void do_xxfiles(char *, FILE *);
static void do_objs(FILE *);
static void do_before_depend(FILE *);
static int opteq(char *, char *);
static int opteq(const char *, const char *);
static void read_files(void);
/*
@ -281,7 +281,7 @@ read_files(void)
struct device *dp;
struct device *save_dp;
struct opt *op;
char *wd, *this, *needs, *special, *depends, *clean, *warn;
char *wd, *this, *needs, *special, *depends, *clean, *warning;
char fname[MAXPATHLEN];
int ddwarned = 0;
int nreqs, first = 1, configdep, isdup, std, filetype,
@ -364,7 +364,7 @@ read_files(void)
special = 0;
depends = 0;
clean = 0;
warn = 0;
warning = 0;
configdep = 0;
needs = 0;
std = mandatory = 0;
@ -451,7 +451,7 @@ read_files(void)
fname, this);
exit(1);
}
warn = ns(wd);
warning = ns(wd);
goto nextparam;
}
nreqs++;
@ -519,7 +519,7 @@ read_files(void)
tp->f_special = special;
tp->f_depends = depends;
tp->f_clean = clean;
tp->f_warn = warn;
tp->f_warn = warning;
goto next;
doneparam:
@ -559,14 +559,14 @@ read_files(void)
tp->f_special = special;
tp->f_depends = depends;
tp->f_clean = clean;
tp->f_warn = warn;
tp->f_warn = warning;
if (pf && pf->f_type == INVISIBLE)
pf->f_flags |= ISDUP; /* mark as duplicate */
goto next;
}
static int
opteq(char *cp, char *dp)
opteq(const char *cp, const char *dp)
{
char c, d;
@ -725,7 +725,7 @@ do_rules(FILE *f)
tp = tail(np);
special = ftp->f_special;
if (special == 0) {
char *ftype = NULL;
const char *ftype = NULL;
static char cmd[128];
switch (ftp->f_type) {

View File

@ -92,7 +92,7 @@ options(void)
/* Fake MAXUSERS as an option. */
op = (struct opt *)malloc(sizeof(*op));
memset(op, 0, sizeof(*op));
op->op_name = "MAXUSERS";
op->op_name = ns("MAXUSERS");
snprintf(buf, sizeof(buf), "%d", maxusers);
op->op_value = ns(buf);
op->op_next = opt;
@ -117,7 +117,8 @@ options(void)
static void
do_option(char *name)
{
char *basefile, *file, *inw;
char *file, *inw;
const char *basefile;
struct opt_list *ol;
struct opt *op, *op_head, *topp;
FILE *inf, *outf;