* Various bug fixes.

This commit is contained in:
Paul Smith 1999-06-14 06:50:28 +00:00
parent 187787286d
commit 2858f7a8f1
5 changed files with 85 additions and 63 deletions

View File

@ -1,3 +1,21 @@
1999-06-14 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): Cast -1 arguments to
variable_expand_string() to long. Alexandre Sauve
<Alexandre.SAUVE@ifp.fr> reports that without casts, this breaks
on a NEC SUPER-UX SX-4 system (and it's wrong without a cast
anyway). Of course, (a) I'd really love to start using function
prototypes, and (b) there's a whole slew of issues related to int
vs. long and signed vs. unsigned in the length handling of
variable buffers, etc. Gross. Needs a complete mucking-out.
* expand.c (variable_expand): Ditto.
* acinclude.m4 (AC_FUNC_SELECT): Slight enhancement for AIX 3.2 by
Lars Hecking <lhecking@nmrc.ucc.ie>.
* read.c (get_next_mword): Allow colons to be escaped in target
names: fix for regression failure.
1999-04-26 Paul D. Smith <psmith@gnu.org>
* main.c (main): Reset read_makefiles to empty after processing so

View File

@ -215,6 +215,7 @@ dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
dnl From a proposed change made on the autoconf list on 2 Feb 1999
dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html
dnl Patch for AIX 3.2 by Lars Hecking <lhecking@nmrc.ucc.ie> on 17 May 1999
AC_DEFUN(AC_FUNC_SELECT,
[AC_CHECK_FUNCS(select)
@ -223,7 +224,7 @@ if test "$ac_cv_func_select" = yes; then
AC_MSG_CHECKING([argument types of select()])
AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
[AC_CACHE_VAL(ac_cv_type_fd_set,dnl
[for ac_cv_type_fd_set in 'fd_set' 'int'; do
[for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
AC_TRY_COMPILE(dnl

12
read.c
View File

@ -806,7 +806,7 @@ read_makefile (filename, flags)
entirely consistent, since we do an unconditional
expand below once we know we don't have a
target-specific variable. */
(void)variable_expand_string(pend, lb_next, -1);
(void)variable_expand_string(pend, lb_next, (long)-1);
lb_next += strlen(lb_next);
p2 = variable_buffer + p2_off;
cmdleft = variable_buffer + cmd_off + 1;
@ -921,7 +921,7 @@ read_makefile (filename, flags)
if (*lb_next != '\0')
{
unsigned int l = p2 - variable_buffer;
(void)variable_expand_string(p2 + plen, lb_next, -1);
(void)variable_expand_string(p2 + plen, lb_next, (long)-1);
p2 = variable_buffer + l;
/* Look for a semicolon in the expanded line. */
@ -1305,12 +1305,14 @@ conditional_line (line, flocp)
if (*line == '(')
++count;
else if (*line == ')')
{
if (count <= 0)
break;
else
--count;
}
}
}
else
{
++line;
@ -1554,6 +1556,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
this = nextf != 0 ? copy_dep_chain (deps) : deps;
if (pattern != 0)
{
/* If this is an extended static rule:
`targets: target%pattern: dep%pattern; cmds',
translate each dependency pattern into a plain filename
@ -1561,7 +1564,8 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
if (!pattern_matches (pattern, pattern_percent, name))
{
/* Give a warning if the rule is meaningless. */
error (flocp,"target `%s' doesn't match the target pattern", name);
error (flocp,
"target `%s' doesn't match the target pattern", name);
this = 0;
}
else
@ -1583,6 +1587,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
d->name = savestring (buffer, o - buffer);
}
}
}
if (!two_colon)
{
@ -2344,6 +2349,7 @@ get_next_mword (buffer, delim, startp, length)
case '\\':
switch (*p)
{
case ':':
case ';':
case '=':
case '\\':

View File

@ -266,7 +266,7 @@ no_rule_error(file)
= "%sNo rule to make target `%s', needed by `%s'%s";
if (keep_going_flag || file->dontcare)
{
if (!file->dontcare)
if (!file->dontcare && !file->shownerror)
{
if (file->parent == 0)
error (NILF, msg_noparent, "*** ", file->name, ".");
@ -355,13 +355,8 @@ update_file_1 (file, depth)
if (file->update_status > 0)
{
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
if (!file->shownerror)
{
int dontcare = file->dontcare;
file->dontcare = 0;
if (!file->shownerror && file->parent)
no_rule_error(file);
file->dontcare = dontcare;
}
return file->update_status;
}

2
rule.c
View File

@ -334,6 +334,7 @@ new_pattern_rule (rule, override)
if (!streq (dep_name (d), dep_name (d2)))
break;
if (d == 0 && d2 == 0)
{
/* All the dependencies matched. */
if (override)
{
@ -357,6 +358,7 @@ new_pattern_rule (rule, override)
}
}
}
}
matched:;