Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 05:47:05 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Peter Wemm <peter@wemm.org>
Cc:        Sheldon Hearn <sheldonh@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/bin/rm Makefile src/bin/cp Makefile src/bin/chmod Makefile 
Message-ID:  <20020712053301.R25129-100000@gamplex.bde.org>
In-Reply-To: <20020711152938.3CC4A380A@overcee.wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 11 Jul 2002, Peter Wemm wrote:

> Sheldon Hearn wrote:
> > sheldonh    2002/07/11 01:45:39 PDT
> >
> >   Modified files:
> >     bin/rm               Makefile
> >     bin/cp               Makefile
> >     bin/chmod            Makefile
> >   Log:
> >   Set WFORMAT=0, because our compiler currently complains about NULL
> >   arg 2 to err() and friends, and warnings are promoted to errors.
>
> Umm, this should already be fixed, see the sys/cdefs.h v1.57 commit.
> I think these should be backed out.

None of these commits should have even been dreamt of.  They just break
the warning.  The warning was really about an uninitialized variable
in the __printf0like format checking support in rev.1.3 of c-format.c.
The variable was initialized from stack garbage.  This resulted in the
warning being turned off randomly.  For some reason it was usually
turned off on i386's and usually left on for alphas.  Note that the
bug affected more than __printf0like.  There was (usually) no warning
for printf(NULL) on i386's.

%%%
Index: c-format.c
===================================================================
RCS file: /home/ncvs/src/contrib/gcc/c-format.c,v
retrieving revision 1.4
diff -u -2 -r1.4 c-format.c
--- c-format.c	26 May 2002 16:04:37 -0000	1.4
+++ c-format.c	11 Jul 2002 17:01:09 -0000
@@ -86,5 +86,4 @@
   unsigned HOST_WIDE_INT format_num;	/* number of format argument */
   unsigned HOST_WIDE_INT first_arg_num;	/* number of first arg (zero for varargs) */
-  int null_format_ok;			/* TRUE if the format string may be NULL */
 } function_format_info;

@@ -941,12 +940,4 @@
 static void check_format_types	PARAMS ((int *, format_wanted_type *));

-
-inline static int get_null_fmt_ok (fmttype)
-	enum format_type fmttype;
-{
-  return format_types[(int)fmttype].null_format_ok;
-}
-
-
 /* Decode a format type from a string, returning the type, or
    format_type_error if not valid, in which case the caller should print an
@@ -1507,5 +1498,6 @@
 	 that case, or maybe add a function pointer to be called at
 	 the end instead of hardcoding check_format_info_main.  */
-      if (!info->null_format_ok) status_warning (status, "null format string");
+      if (!format_types[info->format_type].null_format_ok)
+	status_warning (status, "null format string");

       /* Skip to first argument to check, so we can see if this format
%%%

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020712053301.R25129-100000>